pub struct RequireHttps { /* private fields */ }Expand description
Redirect (308) every plain-HTTP request to the same URL on HTTPS
Implementations§
Source§impl RequireHttps
impl RequireHttps
pub fn new() -> Self
Sourcepub fn https_port(self, port: u16) -> Self
pub fn https_port(self, port: u16) -> Self
Port of the HTTPS listener when it is not 443
Sourcepub fn trust_forwarded_proto(self) -> Self
pub fn trust_forwarded_proto(self) -> Self
Treat requests with X-Forwarded-Proto: https as secure (reverse proxy)
Sourcepub fn allowed_hosts<I, S>(self, hosts: I) -> Self
pub fn allowed_hosts<I, S>(self, hosts: I) -> Self
Only redirect for these host names (any other Host gets 400), so the
redirect can never point at a host the client made up
Trait Implementations§
Source§impl Default for RequireHttps
impl Default for RequireHttps
Auto Trait Implementations§
impl Freeze for RequireHttps
impl RefUnwindSafe for RequireHttps
impl Send for RequireHttps
impl Sync for RequireHttps
impl Unpin for RequireHttps
impl UnsafeUnpin for RequireHttps
impl UnwindSafe for RequireHttps
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