Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

feat(client-http): Add compression support #20

@lambdalisue

Description

@lambdalisue

Summary

Add compression support to the HTTP client for both request and response handling.

Background

Currently, compression is handled entirely by fetch/browser automatically. This limits:

  • Explicit control over Accept-Encoding header
  • Ability to test compressed response handling
  • Potential for request body compression

Proposed API

interface HttpClientConfig {
  // ...existing options
  
  /**
   * Compression configuration.
   */
  readonly compression?: {
    /**
     * Accept-Encoding values to send.
     * @default ["gzip", "deflate", "br"]
     */
    readonly acceptEncoding?: string[];
    
    /**
     * Whether to automatically decompress responses.
     * @default true
     */
    readonly decompress?: boolean;
  };
}

Test Coverage

Once implemented, integration tests can use echo-http service endpoints:

  • GET /gzip - Return gzip-compressed response
  • GET /deflate - Return deflate-compressed response
  • GET /brotli - Return brotli-compressed response

Labels

enhancement, client-http

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions