Skip to content

Strip all hop-by-hop headers from Lambda responses #66

Closed

Description

@danmoz

Description

The Lambda response adapter currently strips Content-Length, Transfer-Encoding, and Connection before copying response headers to the downstream HTTP response.

As Caddy is acting as an HTTP gateway, it should strip the complete set of hop-by-hop headers rather than allowing connection-specific response semantics returned by the Lambda application to propagate to the client.

This should include:

  • Connection
  • Proxy-Connection
  • Keep-Alive
  • Proxy-Authenticate
  • Proxy-Authorization
  • TE
  • Trailer
  • Transfer-Encoding
  • Upgrade

Headers named by the Connection header should also be removed where applicable.

This would bring the response handling closer to the behaviour expected from an HTTP reverse proxy/gateway.

Acceptance criteria

  • All standard hop-by-hop headers are removed from Lambda responses.
  • Headers nominated by the Connection header are also removed.
  • Existing handling of Content-Length is preserved.
  • Tests cover hop-by-hop header removal.
  • Normal end-to-end headers continue to pass through unchanged.

Activity

  1. danmoz commented on Sep 5, 2026

    @danmoz
    OwnerAuthor

    /oc PR please.

  2. opencode-agent commented on Sep 5, 2026

    @opencode-agent
    Contributor

    Created PR #76

    New%20session%20-%202026-09-05T20%3A18%3A31.241Z
    opencode session  |  github run

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions