From 611d677404c345b5f5d66a7a921ddd6c1a6f1563 Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Mon, 10 Apr 2023 22:45:52 +0200 Subject: [PATCH] Better HTTPS detection --- internal/web/gist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/web/gist.go b/internal/web/gist.go index 844a21a..dc09b52 100644 --- a/internal/web/gist.go +++ b/internal/web/gist.go @@ -47,7 +47,7 @@ func gistInit(next echo.HandlerFunc) echo.HandlerFunc { } httpProtocol := "http" - if ctx.Request().TLS != nil { + if ctx.Request().TLS != nil || ctx.Request().Header.Get("X-Forwarded-Proto") == "https" { httpProtocol = "https" } setData(ctx, "httpProtocol", strings.ToUpper(httpProtocol))