pub struct HttpHeaderPolicy { /* private fields */ }Expand description
Exact browser-request, response-exposure, and diagnostic-redaction policy.
Header names are normalized by http::HeaderName, de-duplicated
deterministically, and never accept the wildcard token. Applications own the
baseline policy; installed HTTP plugins add only their exact requirements.
Implementations§
Source§impl HttpHeaderPolicy
impl HttpHeaderPolicy
pub const fn empty() -> Self
pub fn allow_request_header( &mut self, name: HeaderName, ) -> Result<(), HttpConfigurationError>
pub fn expose_response_header( &mut self, name: HeaderName, ) -> Result<(), HttpConfigurationError>
pub fn mark_request_header_sensitive( &mut self, name: HeaderName, ) -> Result<(), HttpConfigurationError>
pub fn allow_request_header_name( &mut self, name: &str, ) -> Result<(), HttpConfigurationError>
pub fn expose_response_header_name( &mut self, name: &str, ) -> Result<(), HttpConfigurationError>
pub fn mark_request_header_name_sensitive( &mut self, name: &str, ) -> Result<(), HttpConfigurationError>
Enables the application-selected cookie/CSRF request boundary.
Cookie is already marked sensitive and is browser-managed, so only
the exact CSRF header is added to the CORS request set.
pub fn allowed_request_headers(&self) -> Vec<HeaderName>
pub fn exposed_response_headers(&self) -> Vec<HeaderName>
pub fn sensitive_request_headers(&self) -> Vec<HeaderName>
Trait Implementations§
Source§impl Clone for HttpHeaderPolicy
impl Clone for HttpHeaderPolicy
Source§fn clone(&self) -> HttpHeaderPolicy
fn clone(&self) -> HttpHeaderPolicy
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 HttpHeaderPolicy
impl Debug for HttpHeaderPolicy
Source§impl Default for HttpHeaderPolicy
impl Default for HttpHeaderPolicy
impl Eq for HttpHeaderPolicy
Source§impl PartialEq for HttpHeaderPolicy
impl PartialEq for HttpHeaderPolicy
impl StructuralPartialEq for HttpHeaderPolicy
Auto Trait Implementations§
impl Freeze for HttpHeaderPolicy
impl RefUnwindSafe for HttpHeaderPolicy
impl Send for HttpHeaderPolicy
impl Sync for HttpHeaderPolicy
impl Unpin for HttpHeaderPolicy
impl UnsafeUnpin for HttpHeaderPolicy
impl UnwindSafe for HttpHeaderPolicy
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
Mutably borrows from an owned value. Read more