Struct junction_api::http::HeaderFilter
source · pub struct HeaderFilter {
pub set: Vec<HeaderValue>,
pub add: Vec<HeaderValue>,
pub remove: Vec<String>,
}
Expand description
Defines configuration for the RequestHeaderModifier filter.
Fields§
§set: Vec<HeaderValue>
Overwrites the request with the given header (name, value) before the action. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
Input: GET /foo HTTP/1.1 my-header: foo
Config: set:
- name: “my-header” value: “bar”
Output: GET /foo HTTP/1.1 my-header: bar
add: Vec<HeaderValue>
Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.
Input: GET /foo HTTP/1.1 my-header: foo
Config: add:
- name: “my-header” value: “bar”
Output: GET /foo HTTP/1.1 my-header: foo my-header: bar
remove: Vec<String>
Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz
Config: remove: [“my-header1”, “my-header3”]
Output: GET /foo HTTP/1.1 my-header2: bar
Trait Implementations§
source§impl Clone for HeaderFilter
impl Clone for HeaderFilter
source§fn clone(&self) -> HeaderFilter
fn clone(&self) -> HeaderFilter
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HeaderFilter
impl Debug for HeaderFilter
source§impl<'de> Deserialize<'de> for HeaderFilter
impl<'de> Deserialize<'de> for HeaderFilter
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for HeaderFilter
impl PartialEq for HeaderFilter
source§impl Serialize for HeaderFilter
impl Serialize for HeaderFilter
impl StructuralPartialEq for HeaderFilter
Auto Trait Implementations§
impl Freeze for HeaderFilter
impl RefUnwindSafe for HeaderFilter
impl Send for HeaderFilter
impl Sync for HeaderFilter
impl Unpin for HeaderFilter
impl UnwindSafe for HeaderFilter
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request