pub struct OriginValidatorBuilder { /* private fields */ }Expand description
Builder for OriginValidator.
Implementations§
Source§impl OriginValidatorBuilder
impl OriginValidatorBuilder
Sourcepub fn allow_subdomain_pattern(self, pattern: &str) -> Self
pub fn allow_subdomain_pattern(self, pattern: &str) -> Self
Sourcepub fn allow_any(self) -> Self
pub fn allow_any(self) -> Self
Allows any origin.
§Warning
This disables origin checking entirely. Only use for development or when you have other security measures in place.
Sourcepub fn allow_missing(self) -> Self
pub fn allow_missing(self) -> Self
Allows requests without an Origin header.
§Warning
Browsers always send an Origin header with WebSocket requests. Missing Origin usually indicates a non-browser client.
Sourcepub fn allow_localhost_in_dev(self, allow: bool) -> Self
pub fn allow_localhost_in_dev(self, allow: bool) -> Self
Allows localhost origins in debug builds.
This adds http://localhost:* and http://127.0.0.1:* to allowed origins
only when compiled in debug mode.
Sourcepub fn build(self) -> OriginValidator
pub fn build(self) -> OriginValidator
Builds the OriginValidator.
Trait Implementations§
Source§impl Clone for OriginValidatorBuilder
impl Clone for OriginValidatorBuilder
Source§fn clone(&self) -> OriginValidatorBuilder
fn clone(&self) -> OriginValidatorBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 OriginValidatorBuilder
impl Debug for OriginValidatorBuilder
Source§impl Default for OriginValidatorBuilder
impl Default for OriginValidatorBuilder
Source§fn default() -> OriginValidatorBuilder
fn default() -> OriginValidatorBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OriginValidatorBuilder
impl RefUnwindSafe for OriginValidatorBuilder
impl Send for OriginValidatorBuilder
impl Sync for OriginValidatorBuilder
impl Unpin for OriginValidatorBuilder
impl UnwindSafe for OriginValidatorBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 more