mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-19 08:27:13 +02:00
Better HTTPS detection
This commit is contained in:
@ -47,7 +47,7 @@ func gistInit(next echo.HandlerFunc) echo.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
httpProtocol := "http"
|
httpProtocol := "http"
|
||||||
if ctx.Request().TLS != nil {
|
if ctx.Request().TLS != nil || ctx.Request().Header.Get("X-Forwarded-Proto") == "https" {
|
||||||
httpProtocol = "https"
|
httpProtocol = "https"
|
||||||
}
|
}
|
||||||
setData(ctx, "httpProtocol", strings.ToUpper(httpProtocol))
|
setData(ctx, "httpProtocol", strings.ToUpper(httpProtocol))
|
||||||
|
Reference in New Issue
Block a user