fix: respect X-Forwarded-Proto header for hasHTTPS in /api/security/status
Fixes issue where /api/security/status reports hasHTTPS=false when accessed via HTTPS through a reverse proxy like Caddy. Resolves feedback from discussion #845 (clar2242).
This commit is contained in:
parent
f29d8b1b43
commit
fdb6789a63
1 changed files with 1 additions and 1 deletions
|
|
@ -549,7 +549,7 @@ func (r *Router) setupRoutes() {
|
||||||
"configuredButPendingRestart": configuredButPendingRestart,
|
"configuredButPendingRestart": configuredButPendingRestart,
|
||||||
"hasAuditLogging": hasAuditLogging,
|
"hasAuditLogging": hasAuditLogging,
|
||||||
"credentialsEncrypted": credentialsEncrypted,
|
"credentialsEncrypted": credentialsEncrypted,
|
||||||
"hasHTTPS": req.TLS != nil,
|
"hasHTTPS": req.TLS != nil || strings.EqualFold(req.Header.Get("X-Forwarded-Proto"), "https"),
|
||||||
"clientIP": clientIP,
|
"clientIP": clientIP,
|
||||||
"isPrivateNetwork": isPrivateNetwork,
|
"isPrivateNetwork": isPrivateNetwork,
|
||||||
"isTrustedNetwork": isTrustedNetwork,
|
"isTrustedNetwork": isTrustedNetwork,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue