Created
January 3, 2013 00:07
-
-
Save mattrobenolt/4439597 to your computer and use it in GitHub Desktop.
Django middleware to capture X-Forwarded-Port header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class XForwardedPort(object): | |
def process_request(self, request): | |
try: | |
request.META['SERVER_PORT'] = request.META['HTTP_X_FORWARDED_PORT'] | |
except KeyError: | |
pass | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment