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

Only accept brotli if we can decode it #5259

Closed
wants to merge 1 commit into from

Conversation

lucaswerkmeister
Copy link

Previously, on Node versions without brotli support, axios might have arbitrarily presented the library user with a brotli-encoded response they didn’t ask for.

Resolves #5258.

Previously, on Node versions without brotli support, axios might have
arbitrarily presented the library user with a brotli-encoded response
they didn’t ask for.
@dlecan
Copy link

dlecan commented Jan 4, 2023

I have an issue with that, ie I receive br encoded data but Brotli encoding is not requested/supported.
Is it possible to merge this PR?

@DigitalBrainJS
Copy link
Collaborator

@dlecan Axios already contains code equivalent to this PR.

axios/lib/adapters/http.js

Lines 333 to 336 in abd2cb8

headers.set(
'Accept-Encoding',
'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
);

@lucaswerkmeister
Copy link
Author

Indeed, #5306 added slightly different code to the same effect, making this PR superfluous.

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.

Axios includes br in Accept-Encoding even if transparent decompression is not supported
4 participants