Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disables the middleware on pages with a status different from 200.

  • Loading branch information...
commit 6d6a7c32fb6a6e0f18afbec286f5312d572a8893 1 parent 3369b46
@BertrandBordage authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  terms/middleware.py
View
2  terms/middleware.py
@@ -23,7 +23,7 @@ def process_response(self, request, response):
is_html = 'text/html' in response['Content-Type']
- if not app_ignored and is_html:
+ if not app_ignored and is_html and response.status_code == 200:
try:
self.parser.feed(response.content.decode('utf-8'))
response.content = self.parser.out
Please sign in to comment.
Something went wrong with that request. Please try again.