Skip to content

Commit 46833c6

Browse files
author
Buky
authored
Merge pull request #706 from gatsinski/fix/html-decoding
Fix 691 - HTML not getting decoded properly by Middleware in Django 2.2
2 parents 83b9de6 + 1ceff95 commit 46833c6

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
@@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs):
1616
def process_response(self, request, response):
1717
if response.has_header('Content-Type') and 'text/html' in response['Content-Type']:
1818
try:
19-
response.content = minify_html(response.content.strip())
19+
response.content = minify_html(response.content.decode().strip())
2020
response['Content-Length'] = str(len(response.content))
2121
except DjangoUnicodeDecodeError:
2222
pass

0 commit comments

Comments
 (0)