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

WebClient: Send Accept-Encoding #1482

Merged
merged 1 commit into from Apr 13, 2024
Merged

WebClient: Send Accept-Encoding #1482

merged 1 commit into from Apr 13, 2024

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Apr 13, 2024

Guzzle does not send Accept-Encoding header by default. That is equivalent to sending Accept-Encoding: *. Most servers will probably return an uncompressed body in response to that, which can be considered wasteful, and can trigger crawler detection systems. Others might even opt to use a compression method that is not supported by the system (e.g. when libcurl is not compiled with brotli support).

Let’s force Guzzle to let curl send Accept-Encoding header reflecting which compression methods it supports: guzzle/guzzle#3215

Fixes: #1481

Guzzle does not send `Accept-Encoding` header by default.
That is equivalent to sending `Accept-Encoding: *`:
https://www.rfc-editor.org/rfc/rfc9110#field.accept-encoding>
Most servers will probably return an uncompressed body
in response to that, which can be considered wasteful,
and can trigger crawler detection systems:
#1481
Others might even opt to use a compression method
that is not supported by the system
(e.g. when libcurl is not compiled with brotli support).

Let’s force Guzzle to let curl send `Accept-Encoding`
header reflecting which compression methods it supports:
guzzle/guzzle#3215
Copy link

netlify bot commented Apr 13, 2024

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit 2429274
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/661ad0729114a50008e6f847

@jtojnar jtojnar added this to the 2.20 milestone Apr 13, 2024
@jtojnar jtojnar added the bug label Apr 13, 2024
@jtojnar jtojnar merged commit 2429274 into master Apr 13, 2024
14 checks passed
@jtojnar jtojnar deleted the accept-encoding branch April 13, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No support for encoding such as gzip or brotli?
1 participant