Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Content-Length header to count bytes #143

Merged
merged 2 commits into from
Sep 4, 2023

Conversation

haydngreatnews
Copy link
Contributor

The minified_content is a string variable, but the content-length must always be specified in bytes.

Using response.content works around this, as response has a setter on content, that encodes the bytes before they're stored

haydngreatnews and others added 2 commits September 4, 2023 15:00
The `minified_content` is a string variable, but the content-length must always be specified in bytes.

Using `response.content` works around this, as `response` has a setter on content, that encodes the bytes before they're stored
@adamchainz adamchainz changed the title Use response content for length calculation Fix Content-Length header to count bytes Sep 4, 2023
@adamchainz adamchainz enabled auto-merge (squash) September 4, 2023 06:55
@adamchainz adamchainz merged commit af8f45f into adamchainz:main Sep 4, 2023
@adamchainz
Copy link
Owner

Thank you, well spotted. I added a changelog note and updated the tests to catch the issue. Released in 1.6.1 🎉

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.

2 participants