pub struct HttpUpstreamRequestPolicy {
pub strip_hop_by_hop: bool,
pub strip_connection_nominated: bool,
pub reject_malformed_connection_nominations: bool,
pub h1_upgrade: H1UpgradePolicy,
}Expand description
Policy for forwarding request headers to HTTP upstreams.
This policy applies to automatically forwarded downstream request headers. Application code may deliberately alter the resulting request in its upstream request filter.
Fields§
§strip_hop_by_hop: boolStrip standard hop-by-hop request fields inherited from the downstream request.
Standard hop-by-hop framing fields are removed. If a non-empty request body is unframed after application upstream request filtering, Pingora sends it chunked to an HTTP/1 upstream.
strip_connection_nominated: boolStrip extension fields identified by tokens in the downstream Connection header field.
Requests nominating Host, forwarding-origin fields, or pseudo-header-shaped fields are
rejected rather than forwarded with protected metadata removed when this behavior is
enabled.
reject_malformed_connection_nominations: boolReject Connection nominations that are not a valid HTTP token (RFC 9110 §5.6.2), such
as Connection: "X-Forwarded-For", instead of tolerating them as distinct literal fields.
Defaults to true. Exact nominations of protected fields and pseudo-headers are rejected
either way. Only has an effect when
strip_connection_nominated is enabled.
h1_upgrade: H1UpgradePolicyControls forwarding of HTTP/1 protocol upgrade request fields.
Implementations§
Source§impl HttpUpstreamRequestPolicy
impl HttpUpstreamRequestPolicy
Sourcepub fn standard() -> Self
pub fn standard() -> Self
Use standards-oriented forwarding with normalized WebSocket upgrade support.
Sourcepub fn preserve() -> Self
pub fn preserve() -> Self
Preserve the previous HTTP/1 upstream request-header passthrough behavior.
This mode is RFC-non-compliant and is provided only for legacy compatibility. Use it at your own risk: the application’s upstream request filter is solely responsible for ensuring valid hop-by-hop header handling.
Sourcepub fn deny_upgrades() -> Self
pub fn deny_upgrades() -> Self
Strip hop-by-hop fields and do not forward any HTTP/1 upgrade handshake.
Trait Implementations§
Source§impl Clone for HttpUpstreamRequestPolicy
impl Clone for HttpUpstreamRequestPolicy
Source§fn clone(&self) -> HttpUpstreamRequestPolicy
fn clone(&self) -> HttpUpstreamRequestPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HttpUpstreamRequestPolicy
Source§impl Debug for HttpUpstreamRequestPolicy
impl Debug for HttpUpstreamRequestPolicy
Source§impl Default for HttpUpstreamRequestPolicy
impl Default for HttpUpstreamRequestPolicy
impl Eq for HttpUpstreamRequestPolicy
impl StructuralPartialEq for HttpUpstreamRequestPolicy
Auto Trait Implementations§
impl Freeze for HttpUpstreamRequestPolicy
impl RefUnwindSafe for HttpUpstreamRequestPolicy
impl Send for HttpUpstreamRequestPolicy
impl Sync for HttpUpstreamRequestPolicy
impl Unpin for HttpUpstreamRequestPolicy
impl UnsafeUnpin for HttpUpstreamRequestPolicy
impl UnwindSafe for HttpUpstreamRequestPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.