Skip to content

Support gzip-compressed HTTP responses - #159

Open
TOMASEZARATE wants to merge 1 commit into
pytest-dev:mainfrom
TOMASEZARATE:gzip-responses
Open

TOMASEZARATE wants to merge 1 commit into
pytest-dev:mainfrom
TOMASEZARATE:gzip-responses

Conversation

@TOMASEZARATE

Copy link
Copy Markdown

Closes #27

The HTTP server already had a compress attribute and a FIXME to gzip the response body, but that code was never finished.

serve_content() now accepts compress='gzip' (or True), and you can still set httpserver.compress = 'gzip' the same way. When the request's Accept-Encoding header allows gzip, the body is compressed and sent with Content-Encoding: gzip and the correct Content-Length. Compression stays off by default, so existing tests are unchanged.

serve_content() now accepts compress='gzip' (or True), matching the
old unfinished compress attribute. The body is gzipped and sent with
Content-Encoding: gzip and the correct Content-Length, but only when
the request's Accept-Encoding header allows it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support compressed responses

1 participant