Ticket #69 (defect)
Opened 5 months ago
Last modified 5 months ago
handle proxied requests with HTTP_X_FORWARDED_PORT not set
Status: new
| Reported by: | marc.sauter@postfinance.ch | Assigned to: | somebody |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | Cc: | james@pythonweb.org | |
If HTTP_X_FORWARDED_HOST is set but not HTTP_X_FORWARDED_PORT for https (seen with mod_proxy on Apache 2.2.9) cunstruct_url (in authkit/authenticate/form.py) assumes port 80. The following patch adds an addtitional check for https:
if host is not None:
# Request was proxied, get the correct data
host = environ.get('HTTP_X_FORWARDED_HOST')
port = environ.get('HTTP_X_FORWARDED_PORT')
if port is None and environ.get('HTTP_X_FORWARDED_SSL') == 'on':
port = '443'
if port is None and environ['wsgi.url_scheme'] == 'https':
port = '443'
Attachments
Change History
04/16/09 11:25:22: Modified by anonymous
- cc set to james@pythonweb.org.
