Skip to content

Z_BUF_ERROR when using get on a gzip sitemap #3989

@exhaler

Description

@exhaler

Describe the issue

Using get to read a gzip sitemap from a third party link. This was working a week a ago, now i'm getting this error:

code:'Z_BUF_ERROR'
message:'unexpected end of file'
stack:'Error: unexpected end of file\n    at Zlib.zlibOnError [as onerror] (zlib.js:182:17)\n    at Zlib.callbackTrampoline (internal/async_hooks.js:126:14)'

Example Code

Code snippet to illustrate your question

let response = await axios.get(`${url}/th-sitemapIndex.xml.gz`, {
 headers: {
   'Accept': '*/*',
   'Accept-Encoding': 'gzip, deflate, br'
 }
});

Expected behavior, if applicable

To be able to read the sitemap

Environment

  • Axios Version 0.20.0
  • Node.js Version 12.22.5
  • OS: Windows 10

Additional context/Screenshots

Add any other context about the problem here. If applicable, add screenshots to help explain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions