Skip to content

Commit f6a68ac

Browse files
Surgomatthiask
authored andcommitted
Encode with response's charset
1 parent 1b17dea commit f6a68ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/middleware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def process_response(self, request, response):
122122
response.set_cookie('djdt', 'hide', 864000)
123123

124124
# Insert the toolbar in the response.
125-
content = force_text(response.content, encoding=settings.DEFAULT_CHARSET)
125+
content = force_text(response.content, encoding=response.charset)
126126
insert_before = dt_settings.get_config()['INSERT_BEFORE']
127127
pattern = re.escape(insert_before)
128128
bits = re.split(pattern, content, flags=re.IGNORECASE)

0 commit comments

Comments
 (0)