Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/debug_toolbar/litestar/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ def _inject_toolbar(self, body: bytes, context: RequestContext, content_encoding
pattern = re.compile(re.escape(insert_before), re.IGNORECASE)
html = pattern.sub(toolbar_html + insert_before, html, count=1)

# Return uncompressed body - we strip content-encoding since we decompressed
# Return body as uncompressed UTF-8 with empty content-encoding.
# This applies to all successful toolbar injections, regardless of whether
# the input was originally compressed (we decompress before processing).
return html.encode("utf-8"), ""

def _render_toolbar(self, data: dict[str, Any]) -> str:
Expand Down
Loading