🏷️ fix types to be explicit about bytes being okay
This commit is contained in:
parent
dca1b89b39
commit
707a3a82c3
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ class MiddlewareMixin:
|
||||||
|
|
||||||
def post_process_middleware(
|
def post_process_middleware(
|
||||||
self, request: Request, response: HttpResponse, rendered_response: str
|
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
|
# run them in reverse order, same as process_response. The top of the middleware
|
||||||
# stack should be the first and last middleware to run.
|
# stack should be the first and last middleware to run.
|
||||||
for middleware in reversed(self.middleware):
|
for middleware in reversed(self.middleware):
|
||||||
|
|
|
@ -41,7 +41,7 @@ class GzipMiddleware(SpiderwebMiddleware):
|
||||||
|
|
||||||
def post_process(
|
def post_process(
|
||||||
self, request: Request, response: HttpResponse, rendered_response: str
|
self, request: Request, response: HttpResponse, rendered_response: str
|
||||||
) -> str:
|
) -> str | bytes:
|
||||||
# Only actually compress the response if the following attributes are true:
|
# Only actually compress the response if the following attributes are true:
|
||||||
#
|
#
|
||||||
# * The response status code is a 2xx success code
|
# * The response status code is a 2xx success code
|
||||||
|
|
Loading…
Add table
Reference in a new issue