Permalink
Browse files

Merge pull request #73 from markotibold/middleware-fix

Only process html and xhtml responses in the middleware
Thanks @markotibold
  • Loading branch information...
2 parents cf42a61 + b1ad3ad commit 597bca27ba8038a930109a942aaa6b08ee29a4e7 @dbunskoek dbunskoek committed Mar 27, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 fiber/middleware.py
View
3 fiber/middleware.py
@@ -25,6 +25,9 @@ def __init__(self):
self.editor_settings = self.get_editor_settings()
def process_response(self, request, response):
+ # only process html and xhtml responses
+ if response['Content-Type'].split(';')[0] not in ('text/html', 'application/xhtml+xml'):
+ return response
if self.set_login_session(request, response):
request.session['show_fiber_admin'] = True
url_without_fiber = request.path_info.replace('@fiber', '')

0 comments on commit 597bca2

Please sign in to comment.