pub enum TrustedHeaderMutation {
Remove(HeaderName),
Set(HeaderName, HeaderValue),
Add(HeaderName, String),
}Expand description
Trusted header mutation recorded during pre-read body processing.
Pre-read filters run before the request-phase pipeline. Mutations they produce cannot be applied immediately because the request headers have already been captured. Instead, they are stored as an ordered log and replayed when the pipeline runs.
Downstream-supplied headers are untrusted. Only mutations in this
log are considered authoritative by provenance-aware filters such
as endpoint_selector.
Variants§
Remove(HeaderName)
Remove the header from the request.
Set(HeaderName, HeaderValue)
Set (overwrite) the header to a specific value.
Stores http::header::HeaderValue to preserve non-text bytes
faithfully.
Add(HeaderName, String)
Add the header with a string value.
Uses String rather than HeaderValue because pre-read
extra_request_headers are string-typed. Trusted routing
values are always text (e.g. host:port addresses).
Implementations§
Source§impl TrustedHeaderMutation
impl TrustedHeaderMutation
Sourcepub fn matches_header(&self, name: &HeaderName) -> bool
pub fn matches_header(&self, name: &HeaderName) -> bool
Whether this mutation targets the given header name.
Trait Implementations§
Source§impl Clone for TrustedHeaderMutation
impl Clone for TrustedHeaderMutation
Source§fn clone(&self) -> TrustedHeaderMutation
fn clone(&self) -> TrustedHeaderMutation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more