[CalendarServer-changes] [10169] CalendarServer/trunk/calendarserver/push/applepush.py
source_changes at macosforge.org
source_changes at macosforge.org
Fri Dec 14 10:01:19 PST 2012
Revision: 10169
http://trac.calendarserver.org//changeset/10169
Author: sagen at apple.com
Date: 2012-12-14 10:01:19 -0800 (Fri, 14 Dec 2012)
Log Message:
-----------
Honor x-forwarded-for when recording client information during APNS subscription
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/push/applepush.py
Modified: CalendarServer/trunk/calendarserver/push/applepush.py
===================================================================
--- CalendarServer/trunk/calendarserver/push/applepush.py 2012-12-14 17:16:56 UTC (rev 10168)
+++ CalendarServer/trunk/calendarserver/push/applepush.py 2012-12-14 18:01:19 UTC (rev 10169)
@@ -798,6 +798,9 @@
userAgent = request.headers.getHeader("user-agent", "-")
host = request.remoteAddr.host
+ fwdHeaders = request.headers.getRawHeaders("x-forwarded-for", [])
+ if fwdHeaders:
+ host = fwdHeaders[0]
if not (key and token):
code = responsecode.BAD_REQUEST
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121214/66f0d374/attachment.html>
More information about the calendarserver-changes
mailing list