Skip to content
Permalink
Browse files

Use X-F-F header value for client IP address when using unix socket b…

…ased proxy.

git-svn-id: https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@14957 e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information...
cyrusdaboo committed Jul 10, 2015
1 parent 7c3cfe5 commit e3f31cbabc07c334a4827b2e4784b6d07f34a227
Showing with 7 additions and 0 deletions.
  1. +7 −0 calendarserver/accesslog.py
@@ -181,6 +181,13 @@ def convertPrincipaltoShortName(principal):
format += " fwd=%(fwd)s"
formatArgs["fwd"] = forwardedFor

if formatArgs["host"] == "0.0.0.0":
fwdHeaders = request.headers.getRawHeaders("x-forwarded-for", "")
if fwdHeaders:
formatArgs["host"] = fwdHeaders[-1].split(",")[-1].strip()
format += " unix=%(unix)s"
formatArgs["unix"] = "true"

elif "overloaded" in eventDict:
overloaded = eventDict.get("overloaded")

0 comments on commit e3f31cb

Please sign in to comment.
You can’t perform that action at this time.