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

Deflate fails on server response without zlib header #3887

Closed
Semptic opened this issue Jul 7, 2021 · 1 comment · Fixed by #5497
Closed

Deflate fails on server response without zlib header #3887

Semptic opened this issue Jul 7, 2021 · 1 comment · Fixed by #5497

Comments

@Semptic
Copy link

Semptic commented Jul 7, 2021

Describe the bug

Some servers are not sending a zlib header in their deflated data. CURL had the same problem and implemented a "fix" for it: https://github.com/curl/curl/blob/5c932f8fe9dad94a7417702958ffa9e8db67c549/lib/content_encoding.c#L227-L229

Axios is also returning a Z_DATA_ERROR in this case.

To Reproduce

Use axios to request a page without a zlib header in the deflated data (e.g. https://www.konicaminolta.eu/eu-en/about-us/corporate-book) and force it to only accept deflate encoding.

let url = 'https://www.konicaminolta.eu/eu-en/about-us/corporate-book';
let config = {
  headers: { 'Accept-Encoding': 'deflate' }
};

await axios.get(url, config);

Expected behavior

Getting the correctly inflated data.

Environment

  • Axios Version [0.21.1]

Additional context/Screenshots

@jasonsaayman
Copy link
Member

Hi 👋

Please could you retry with the latest version and open a new issue should this error still be relevant?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants