Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Router: streamResponseHeaderOverwrite

Give downstream streaming headers precedence over existing response headers.

Type: List of string. Default: Six headers; see property page.

Meaning

Names of response headers whose existing gateway values should give way to the actual downstream streaming response. This prevents a header already set by another handler from masking the stream’s Content-Type, cache policy, or framing.

streamResponseHeaderOverwrite:
  - Content-Type
  - Cache-Control
  - Connection
  - Transfer-Encoding
  - Content-Encoding
  - Content-Length

This is the complete default list:

HeaderReason for including it
Content-TypePreserve the backend’s streaming media type, such as text/event-stream.
Cache-ControlPreserve the backend’s stream-specific caching policy.
ConnectionAvoid retaining a conflicting connection policy; protocol handling still applies.
Transfer-EncodingAvoid retaining incompatible transfer framing.
Content-EncodingPrevent stale encoding metadata from describing the wrong body.
Content-LengthAvoid an ordinary response length being applied to an open-ended stream.

The list contains header names, not name: value assignments. It neither invents Cache-Control: no-cache nor requests gzip. In Java, these existing outbound headers are removed before downstream headers are copied, and Content-Length is removed from a confirmed stream. Rust captures the backend’s values for these names and restores them after response handlers, with separate protocol/framing handling.

streamResponseHeaderOverwrite: []

Disables the configured overwrite list. Other mandatory framing cleanup still applies. This is usually unsuitable when another response handler sets ordinary-content headers. If customizing the list, retain the default entries unless you have checked the complete response chain.

See Router configuration for Portal/values.yml syntax, runtime compatibility, and source references.