Use X-Forwarded-Host if available

This commit is contained in:
Daniel García 2018-07-13 00:33:28 +02:00
parent be4e6c6f0c
commit 8ff50481e5
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers {
"http" "http"
}; };
let host = if let Some(host) = headers.get_one("Host") { let host = if let Some(host) = headers.get_one("X-Forwarded-Host") {
host
} else if let Some(host) = headers.get_one("Host") {
host host
} else { } else {
"" ""