Skip to content

fetch() does not decompress gzip responses #238

Description

@mattfysh

fetch() appears to return the raw gzip-compressed response body instead of transparently decompressing it.

Minimal repro:

const res = await fetch('https://httpbin.org/gzip')

console.log(res.status)
console.log(res.headers.get('content-encoding'))
console.log(await res.text())

Observed:

200
gzip
<binary gzip data>

Expected:

200
gzip
{
  "gzipped": true,
  ...
}

Response.text() should expose the decompressed body.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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