Struct actix_web_lab::middleware::RedirectHttps
source · [−]pub struct RedirectHttps { /* private fields */ }
Expand description
A middleware to redirect traffic to HTTPS if connection is insecure.
HSTS
HTTP Strict Transport Security (HSTS) is configurable. Care should be taken when setting up HSTS for your site; misconfiguration can potentially leave parts of your site in an unusable state. By default it is disabled.
See Hsts
docs for more info.
Examples
use actix_web_lab::{header::Hsts, middleware::RedirectHttps};
App::new().wrap(RedirectHttps::default());
App::new().wrap(RedirectHttps::default().to_port(8443));
App::new().wrap(RedirectHttps::with_hsts(Hsts::default()));
App::new().wrap(RedirectHttps::with_hsts(Hsts::new(Duration::from_secs(60 * 60))));
App::new().wrap(RedirectHttps::with_hsts(Hsts::recommended()));
Implementations
sourceimpl RedirectHttps
impl RedirectHttps
Trait Implementations
sourceimpl Clone for RedirectHttps
impl Clone for RedirectHttps
sourcefn clone(&self) -> RedirectHttps
fn clone(&self) -> RedirectHttps
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RedirectHttps
impl Debug for RedirectHttps
sourceimpl Default for RedirectHttps
impl Default for RedirectHttps
sourcefn default() -> RedirectHttps
fn default() -> RedirectHttps
Returns the “default value” for a type. Read more
sourceimpl<S, B> Transform<S, ServiceRequest> for RedirectHttps where
S: Service<ServiceRequest, Response = ServiceResponse<B>> + 'static,
impl<S, B> Transform<S, ServiceRequest> for RedirectHttps where
S: Service<ServiceRequest, Response = ServiceResponse<B>> + 'static,
type Response = ServiceResponse<EitherBody<B, ()>>
type Response = ServiceResponse<EitherBody<B, ()>>
Responses produced by the service.
type Transform = RedirectHttpsMiddleware<S>
type Transform = RedirectHttpsMiddleware<S>
The TransformService
value created by this factory
sourcefn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl RefUnwindSafe for RedirectHttps
impl Send for RedirectHttps
impl Sync for RedirectHttps
impl Unpin for RedirectHttps
impl UnwindSafe for RedirectHttps
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more