From 45da1484930a675c38f9154f89f819542fe7ad41 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 4 Jun 2021 20:58:31 -0700 Subject: [PATCH] Add globals REQUEST_TYPES, RESPONSE_TYPES. --- voussoirkit/flasktools.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/voussoirkit/flasktools.py b/voussoirkit/flasktools.py index 268a56c..b532b11 100644 --- a/voussoirkit/flasktools.py +++ b/voussoirkit/flasktools.py @@ -1,5 +1,7 @@ +import flask import gzip import io +import werkzeug.wrappers from voussoirkit import bytestring @@ -7,6 +9,9 @@ GZIP_MINIMUM_SIZE = 500 * bytestring.BYTE GZIP_MAXIMUM_SIZE = 5 * bytestring.MIBIBYTE GZIP_LEVEL = 3 +REQUEST_TYPES = (flask.Request, werkzeug.wrappers.Request, werkzeug.local.LocalProxy) +RESPONSE_TYPES = (flask.Response, werkzeug.wrappers.Response) + def gzip_response(request, response): if response.direct_passthrough: return response