pub enum ExternalBaseUrl {
Auto,
Fixed(String),
}Expand description
Parsed representation of the oidc_redirect_url_base config value.
Variants§
Implementations§
Source§impl ExternalBaseUrl
impl ExternalBaseUrl
Sourcepub fn resolve_url(
&self,
headers: &HeaderMap,
fallback_host: &str,
fallback_port: u16,
) -> Result<Url, ParseError>
pub fn resolve_url( &self, headers: &HeaderMap, fallback_host: &str, fallback_port: u16, ) -> Result<Url, ParseError>
Resolve the external base URL from config + HTTP request headers.
When config is Auto, the priority is:
Forwardedheader (RFC 7239) — extracthostandprotoX-Forwarded-Host/X-Forwarded-Proto(common non-standard)Host/:authority(standard HTTP header)- Fallback to
http://{bind_host}:{bind_port}
When config is Fixed(url), just return that URL.
Trait Implementations§
Source§impl Clone for ExternalBaseUrl
impl Clone for ExternalBaseUrl
Source§fn clone(&self) -> ExternalBaseUrl
fn clone(&self) -> ExternalBaseUrl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExternalBaseUrl
impl Debug for ExternalBaseUrl
Source§impl Default for ExternalBaseUrl
impl Default for ExternalBaseUrl
Source§fn default() -> ExternalBaseUrl
fn default() -> ExternalBaseUrl
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExternalBaseUrl
impl<'de> Deserialize<'de> for ExternalBaseUrl
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ExternalBaseUrl
impl Display for ExternalBaseUrl
Source§impl FromStr for ExternalBaseUrl
impl FromStr for ExternalBaseUrl
Auto Trait Implementations§
impl Freeze for ExternalBaseUrl
impl RefUnwindSafe for ExternalBaseUrl
impl Send for ExternalBaseUrl
impl Sync for ExternalBaseUrl
impl Unpin for ExternalBaseUrl
impl UnsafeUnpin for ExternalBaseUrl
impl UnwindSafe for ExternalBaseUrl
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> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.