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 3333PROXY_SERVICE_NAME = 'haproxy'
3434PROXY_SERVICE_CMD = 'haproxy'
3535
36+ CONTENT_ENCODERS = ('gzip' , 'deflate' )
37+
3638
3739class InvalidUserOrGroupException (Exception ):
3840 pass
@@ -162,6 +164,12 @@ def _http_response(http_response, request):
162164 status = http_response .status_code ,
163165 content_type = http_response .headers ['content-type' ],
164166 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+
165173 # NOTE(ralonsoh): there should be a better way to format the HTTP
166174 # response, adding the HTTP version to the ``webob.Response``
167175 # output string.
You can’t perform that action at this time.
0 commit comments