File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 33
33
PROXY_SERVICE_NAME = 'haproxy'
34
34
PROXY_SERVICE_CMD = 'haproxy'
35
35
36
+ CONTENT_ENCODERS = ('gzip' , 'deflate' )
37
+
36
38
37
39
class InvalidUserOrGroupException (Exception ):
38
40
pass
@@ -162,6 +164,12 @@ def _http_response(http_response, request):
162
164
status = http_response .status_code ,
163
165
content_type = http_response .headers ['content-type' ],
164
166
charset = http_response .encoding )
167
+ # The content of the response is decoded depending on the
168
+ # "Context-Enconding" header, if present. The operation is limited to
169
+ # ("gzip", "deflate"), as is in the ``webob.response.Response`` class.
170
+ if _res .content_encoding in CONTENT_ENCODERS :
171
+ _res .decode_content ()
172
+
165
173
# NOTE(ralonsoh): there should be a better way to format the HTTP
166
174
# response, adding the HTTP version to the ``webob.Response``
167
175
# output string.
You can’t perform that action at this time.
0 commit comments