Struct salvo::prelude::ForceHttps
source · pub struct ForceHttps { /* private fields */ }
Available on crate feature
force-https
only.Expand description
Middleware for force redirect to http uri.
Implementations§
source§impl ForceHttps
impl ForceHttps
sourcepub fn new() -> ForceHttps
pub fn new() -> ForceHttps
Create new ForceHttps
middleware.
sourcepub fn https_port(self, port: u16) -> ForceHttps
pub fn https_port(self, port: u16) -> ForceHttps
Specify https port.
sourcepub fn skipper(self, skipper: impl Skipper) -> ForceHttps
pub fn skipper(self, skipper: impl Skipper) -> ForceHttps
Uses a closure to determine if a request should be redirect.
Trait Implementations§
source§impl Default for ForceHttps
impl Default for ForceHttps
source§fn default() -> ForceHttps
fn default() -> ForceHttps
Returns the “default value” for a type. Read more
source§impl Handler for ForceHttps
impl Handler for ForceHttps
source§fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
ForceHttps: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
ForceHttps: 'async_trait,
Handle http request.