mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 13:02:39 +00:00
Better HTTPS detection
This commit is contained in:
parent
2fe309663d
commit
611d677404
1 changed files with 1 additions and 1 deletions
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue