Skip to content

Commit

Permalink
Update comment to link to RFC
Browse files Browse the repository at this point in the history
  • Loading branch information
bouk committed Nov 29, 2023
1 parent 9ca38f0 commit ed7d490
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions axum/src/extract/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ use http::{

const X_FORWARDED_HOST_HEADER_KEY: &str = "X-Forwarded-Host";

/// Extractor that resolves the hostname of the request.
/// Extractor that resolves the host of the request.
///
/// Hostname is resolved through the following, in order:
/// Host is resolved through the following, in order:
/// - `Forwarded` header
/// - `X-Forwarded-Host` header
/// - `Host` header
/// - request target / URI
/// - Authority of the request URI
///
/// See https://www.rfc-editor.org/rfc/rfc9110.html#name-host-and-authority for the definition of
/// host.
///
/// Note that user agents can set `X-Forwarded-Host` and `Host` headers to arbitrary values so make
/// sure to validate them to avoid security issues.
Expand Down

0 comments on commit ed7d490

Please sign in to comment.