diff --git a/src/debug_toolbar/litestar/middleware.py b/src/debug_toolbar/litestar/middleware.py index b306323..eeb62f3 100644 --- a/src/debug_toolbar/litestar/middleware.py +++ b/src/debug_toolbar/litestar/middleware.py @@ -2,6 +2,7 @@ from __future__ import annotations +import gzip import logging import re import time @@ -490,8 +491,6 @@ def _inject_toolbar(self, body: bytes, context: RequestContext, content_encoding Tuple of (modified body, content_encoding to use). If gzip was decompressed, returns uncompressed body with empty encoding. """ - import gzip - # Handle gzip-compressed responses is_gzipped = content_encoding.lower() == "gzip" if is_gzipped: