From 8ff50481e58256f274ef364f9ea29759752df4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Fri, 13 Jul 2018 00:33:28 +0200 Subject: [PATCH] Use X-Forwarded-Host if available --- src/auth.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auth.rs b/src/auth.rs index a2261edd..15b184b9 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -128,7 +128,9 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers { "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 } else { ""