summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-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,