Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix compatibility with mod_python on Apache - fixes #39

- added checks to see if request.META['QUERYSTRING'] is None to middleware.py
  • Loading branch information...
commit c4b4f082f0a9a4bf1b755390543509535e01d641 1 parent b361338
@dbunskoek dbunskoek authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 fiber/middleware.py
View
8 fiber/middleware.py
@@ -45,8 +45,10 @@ def process_response(self, request, response):
if self.set_login_session(request, response):
request.session['show_fiber_admin'] = True
url_without_fiber = request.path.replace('@fiber', '')
- querystring_without_fiber = request.META['QUERY_STRING'].replace('@fiber', '')
- if(querystring_without_fiber != ''):
+ querystring_without_fiber = ''
+ if request.META['QUERY_STRING']:
+ querystring_without_fiber = request.META['QUERY_STRING'].replace('@fiber', '')
+ if (querystring_without_fiber != ''):
querystring = '?%s' % querystring_without_fiber
else:
querystring = ''
@@ -102,7 +104,7 @@ def set_login_session(self, request, response):
"""
if response['Content-Type'].split(';')[0] not in ('text/html', 'application/xhtml+xml'):
return False
- if not (request.path.endswith('@fiber') or request.META['QUERY_STRING'].endswith('@fiber')):
+ if not (request.path.endswith('@fiber') or (request.META['QUERY_STRING'] and request.META['QUERY_STRING'].endswith('@fiber'))):
return False
else:
return True
Please sign in to comment.
Something went wrong with that request. Please try again.