Fix HTTPS detection
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2024-07-05 22:08:12 +02:00
parent c0b29c03f2
commit 0e5e2f55c5

View File

@ -32,6 +32,7 @@ pub async fn get_configuration(req: HttpRequest) -> impl Responder {
let is_secure_request = req let is_secure_request = req
.headers() .headers()
.get("HTTP_X_FORWARDED_PROTO") .get("HTTP_X_FORWARDED_PROTO")
.or_else(|| req.headers().get("X-Forwarded-Proto"))
.map(|v| v.to_str().unwrap_or_default().to_lowercase().eq("https")) .map(|v| v.to_str().unwrap_or_default().to_lowercase().eq("https"))
.unwrap_or(false); .unwrap_or(false);