pub enum HeaderEditMode {
Append,
SetIfAbsent,
Set,
}Expand description
How apply_response_header_edits should interpret a per-edit value.
The implicit empty-val Append → delete encoding is still supported
(so legacy operator-supplied [[...frontends.headers]] entries work
unchanged); the explicit modes give typed policies finer control:
Append: drop the legacy delete shortcut for emptyval, and append every other entry before the end-of-headers flag.SetIfAbsent: skip the insert whenkawa.blocksalready carries a non-elided header with the same name (case-insensitive). HSTS uses this by default to preserve a backend-suppliedStrict-Transport-Security(RFC 6797 §6.1 single-header requirement).Set: delete every existing header with the matching name, then insert the new entry. Use when the operator wants their typed policy to override any backend-supplied value (theforce_replace_backend = trueHSTS shape, for example).
Variants§
Append
Append the header before the end-of-headers flag. Empty val
is interpreted as a delete (legacy behaviour preserved).
SetIfAbsent
Skip the insert if kawa.blocks already contains a non-elided
header whose name matches key case-insensitively. Otherwise
behave like Append.
Set
Delete every existing header with the matching name, then insert the new value. Equivalent to two operator-defined edits (delete + append) but safer to express as one typed entry.
Trait Implementations§
Source§impl Clone for HeaderEditMode
impl Clone for HeaderEditMode
Source§fn clone(&self) -> HeaderEditMode
fn clone(&self) -> HeaderEditMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeaderEditMode
impl Debug for HeaderEditMode
Source§impl Default for HeaderEditMode
impl Default for HeaderEditMode
Source§fn default() -> HeaderEditMode
fn default() -> HeaderEditMode
Returns the “default value” for a type. Read more
Source§impl PartialEq for HeaderEditMode
impl PartialEq for HeaderEditMode
Source§fn eq(&self, other: &HeaderEditMode) -> bool
fn eq(&self, other: &HeaderEditMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HeaderEditMode
impl Eq for HeaderEditMode
impl StructuralPartialEq for HeaderEditMode
Auto Trait Implementations§
impl Freeze for HeaderEditMode
impl RefUnwindSafe for HeaderEditMode
impl Send for HeaderEditMode
impl Sync for HeaderEditMode
impl Unpin for HeaderEditMode
impl UnsafeUnpin for HeaderEditMode
impl UnwindSafe for HeaderEditMode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
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§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
Compare self to
key and return true if they are equal.