Better HTTPS detection

This commit is contained in:
Thomas Miceli 2023-04-10 22:45:52 +02:00
parent 2fe309663d
commit 611d677404
No known key found for this signature in database
GPG key ID: D86C6F6390AF050F

View file

@ -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))