summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed AbdelHalim <[email protected]>2025-09-13 16:54:59 +0200
committerAhmed AbdelHalim <[email protected]>2025-09-13 16:54:59 +0200
commited854ec905a58650a60b5bdddd857986ec08784a (patch)
tree9cc3a9be5b32e0463ff3c97e9325b0fa11b2868d
parent0e89ae072d94650d382707c3cf7a1c5b38ba35f8 (diff)
Fix handling IsHTTPS warning behind reverse proxiesHEADmain
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index e9137a2..1ef9a0b 100644
--- a/main.go
+++ b/main.go
@@ -223,7 +223,10 @@ func (s *Server) handleLogin(w http.ResponseWriter, r *http.Request) {
func (s *Server) showLoginForm(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
- isHTTPS := r.TLS != nil
+ isHTTPS := r.TLS != nil ||
+ r.Header.Get("X-Forwarded-Proto") == "https" ||
+ r.Header.Get("X-Forwarded-Ssl") == "on" ||
+ r.Header.Get("X-Url-Scheme") == "https"
templateData := map[string]any{
"Error": "",
"IsHTTPS": isHTTPS,