🏷️ fix types to be explicit about bytes being okay

This commit is contained in:
Joe Kaufeld 2024-10-29 23:50:07 -04:00
parent dca1b89b39
commit 707a3a82c3
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ class MiddlewareMixin:
def post_process_middleware(
self, request: Request, response: HttpResponse, rendered_response: str
) -> str:
) -> str | bytes:
# run them in reverse order, same as process_response. The top of the middleware
# stack should be the first and last middleware to run.
for middleware in reversed(self.middleware):

View file

@ -41,7 +41,7 @@ class GzipMiddleware(SpiderwebMiddleware):
def post_process(
self, request: Request, response: HttpResponse, rendered_response: str
) -> str:
) -> str | bytes:
# Only actually compress the response if the following attributes are true:
#
# * The response status code is a 2xx success code