1
0
mirror of https://github.com/thomiceli/opengist synced 2025-02-21 17:19:34 +01:00

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

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