Skip to main content

Module forward

Module forward 

Source
Expand description

Upstream request forwarding.

Once the pipeline allows (or redacts) a request, forward_request sends the body upstream. Responses are streamed back by the handler.

Constants§

HOP_BY_HOP_HEADERS
Hop-by-hop headers (RFC 9110, section 7.6.1). They describe one connection, not the message, so a proxy must not pass them on in either direction. Any header named in a Connection header is hop-by-hop too; see forwardable_headers.
STRIPPED_REQUEST_HEADERS
Headers stripped from the request before forwarding upstream, in addition to HOP_BY_HOP_HEADERS.
STRIPPED_RESPONSE_HEADERS
Headers stripped from the upstream response before it goes back to the client, in addition to HOP_BY_HOP_HEADERS. content-length is recomputed by the proxy’s HTTP server, since redaction can change the body.

Functions§

forward_passthrough
Forward a request on a passthrough route (server.passthrough_paths) with its method, body and headers as the client sent them.
forward_request
Forward a (possibly redacted) request body to the upstream LLM API.
forwardable_headers
The headers of headers that may be forwarded, as lowercase name/value pairs: everything except HOP_BY_HOP_HEADERS, headers named in a Connection header, extra_stripped, and values that aren’t visible ASCII.
read_body
Read the full response body as bytes.