Skip to content

Responses with multiple Content-Encoding headers not decompressed #7051

Description

@james-elicx

Responses containing multiple content-encoding headers do not fully decompress the body, resulting in an unexpected value being received.

It appears that workerd looks for an exact value match in the content-encoding header when deciding what to do (https://github.com/cloudflare/workerd/blob/main/src/workerd/api/system-streams.c%2B%2B#L413-L428), and as a result does not seem to support stacked headers, as they're merged into a comma-delimited list that is not walked through from what i understand.

Example reproduction in a branch in our repo - https://github.com/cloudflare/vinext/blob/codex%2Fworkerd-stacked-content-encoding-repro/repros/workerd-stacked-content-encoding/README.md

Image

Whereas, Node will decode for both of the values and return the expected response.

This surfaced in a customer's reproduction in cloudflare/vinext#2983

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