aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/app.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-21 00:06:38 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-21 00:06:38 +0100
commit871fc591dd2492d2bdca0a530fdffac14f3feece (patch)
treefda18c5f953751b8003dccb0b0bad1ec9f908a1b /mediagoblin/app.py
parent463a5dcc433f6e4a442eeaee67bd22910cfb2d08 (diff)
downloadmediagoblin-871fc591dd2492d2bdca0a530fdffac14f3feece.tar.lz
mediagoblin-871fc591dd2492d2bdca0a530fdffac14f3feece.tar.xz
mediagoblin-871fc591dd2492d2bdca0a530fdffac14f3feece.zip
Workaround for Routes/urlgen bug.
This is relevant for fcgi: Some servers (cherokee for example) put "HTTP":"off" in the environ. And the following code in urlgen breaks on this: if environ.get('HTTPS') or environ.get('wsgi.url_scheme') == 'https' \ or environ.get('HTTP_X_FORWARDED_PROTO') == 'https': hostinfo['protocol'] = 'https' workaround is to remove HTTPS:off from the environ.
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r--mediagoblin/app.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py
index 04eb2acc..49dc8d97 100644
--- a/mediagoblin/app.py
+++ b/mediagoblin/app.py
@@ -122,6 +122,10 @@ class MediaGoblinApp(object):
# The other option would be:
# request.full_path = environ["SCRIPT_URL"]
+ # Fix up environ for urlgen
+ if environ.get('HTTPS', '').lower() == 'off':
+ environ.pop('HTTPS')
+
## Attach utilities to the request object
request.matchdict = route_match
request.urlgen = routes.URLGenerator(self.routing, environ)