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 more