Skip to content

Add request decompression middleware #112

Open

Description

@aram356

Description

Decode incoming request bodies with gzip, deflate and Brotli through a portable middleware API.

Existing core helpers decode gzip and Brotli streams used by outbound proxy clients. They are not incoming request middleware, and the workspace compression dependency does not enable deflate.

Steps to reproduce

  1. Inspect the current decoders and middleware implementations.
  2. Inspect the async-compression workspace features and compare them with the three requested request encodings.

Expected behavior

Handlers receive decoded request bytes under an explicit middleware/configuration contract, with consistent headers and controlled resource use.

Impact

Compressed uploads require application-specific code, and unbounded decoding would expose applications to excessive expansion.

Proposed fix

Add a bounded incoming decode layer using the existing portable stream types; support all three requested formats and define invalid/unsupported encoding behavior.

Done when

  • Incoming gzip, deflate and Brotli bodies decode correctly across chunk boundaries.
  • Malformed/truncated/unsupported encoding behavior is documented and tested.
  • Decoded-size limits and stream errors are enforced without collecting unbounded output.
  • Encoding and length metadata are updated consistently before downstream extractors run.

Related

Activity

  1. changed the title [-]Request decompression middleware[/-] [+]Add request decompression middleware[/+] on Nov 9, 2026
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions