Commit 85600af7 by Camilo Nova

Recalculate content-length

It is needed according to
https://github.com/django/django/blob/master/django/middleware/gzip.py#L46
parent ece0f943
......@@ -17,6 +17,7 @@ class MinifyHTMLMiddleware(object):
if response.has_header('Content-Type') and 'text/html' in response['Content-Type']:
try:
response.content = minify_html(response.content.strip())
response['Content-Length'] = str(len(response.content))
except DjangoUnicodeDecodeError:
pass
return response
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment