Skip to content

Commit

Permalink
Remove deprecated charset property from process_response content craf…
Browse files Browse the repository at this point in the history
…ting (#211)

The `Request.charset` property is deprecated since Werkzeug version 2.3. It was removed in Werkzeug 3.0. Request data must always be UTF-8.

https://werkzeug.palletsprojects.com/en/2.3.x/wrappers/#werkzeug.wrappers.Request.charset
  • Loading branch information
dadavec authored Nov 16, 2023
1 parent 8a4cfa5 commit e1c8704
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flask_debugtoolbar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def process_response(self, response):
toolbar_html = toolbar.render_toolbar()

content = ''.join((before, toolbar_html, after))
content = content.encode(response.charset)
content = content.encode('utf-8')
if 'gzip' in response.headers.get('Content-Encoding'):
content = gzip_compress(content)
response.response = [content]
Expand Down

0 comments on commit e1c8704

Please sign in to comment.