Skip to content

Commit 1ceff95

Browse files
committed
Fix 691 - HTML not getting decoded properly by Middleware in Django 2.2
1 parent decffd3 commit 1ceff95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pipeline/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
1818
def process_response(self, request, response):
1919
if response.has_header('Content-Type') and 'text/html' in response['Content-Type']:
2020
try:
21-
response.content = minify_html(response.content.strip())
21+
response.content = minify_html(response.content.decode().strip())
2222
response['Content-Length'] = str(len(response.content))
2323
except DjangoUnicodeDecodeError:
2424
pass

0 commit comments

Comments
 (0)