Description
Add extractors for obtaining the hostname from HTTP requests:
Host extractor
Extracts the hostname from the standard Host header only. Falls back to "localhost" if not present.
#[action]
pub async fn handler(Host(host): Host) -> Response {
// host = value from Host header only
}
ForwardedHost extractor
Extracts the effective hostname, checking X-Forwarded-Host first (set by reverse proxies/load balancers), then falling back to the Host header.
#[action]
pub async fn handler(ForwardedHost(host): ForwardedHost) -> Response {
// host = X-Forwarded-Host if present, otherwise Host header
}
Acceptance Criteria
🤖 Generated with Claude Code
Description
Add extractors for obtaining the hostname from HTTP requests:
HostextractorExtracts the hostname from the standard
Hostheader only. Falls back to "localhost" if not present.ForwardedHostextractorExtracts the effective hostname, checking
X-Forwarded-Hostfirst (set by reverse proxies/load balancers), then falling back to theHostheader.Acceptance Criteria
Hostextractor extracts fromHostheader onlyForwardedHostextractor prioritizesX-Forwarded-HostoverHostDerefandinto_inner()methods available on both🤖 Generated with Claude Code