Trait salvo::prelude::CsrfDepotExt
source · [−]pub trait CsrfDepotExt {
fn csrf_token(&self) -> Option<&str>;
fn csrf_header_name(&self) -> Option<&str>;
fn csrf_query_param(&self) -> Option<&str>;
fn csrf_field_name(&self) -> Option<&str>;
}
Available on crate feature
csrf
only.Expand description
Provides access to request-level CSRF values.
Required Methods
sourcefn csrf_token(&self) -> Option<&str>
fn csrf_token(&self) -> Option<&str>
Gets the CSRF token for inclusion in an HTTP request header, a query parameter, or a form field.
sourcefn csrf_header_name(&self) -> Option<&str>
fn csrf_header_name(&self) -> Option<&str>
Gets the name of the header in which to returns the CSRF token, if the CSRF token is being returned in a header.
sourcefn csrf_query_param(&self) -> Option<&str>
fn csrf_query_param(&self) -> Option<&str>
Gets the name of the query param in which to returns the CSRF token, if the CSRF token is being returned in a query param.
sourcefn csrf_field_name(&self) -> Option<&str>
fn csrf_field_name(&self) -> Option<&str>
Gets the name of the form field in which to returns the CSRF token, if the CSRF token is being returned in a form field.