Browse Source

Look for X-Forwarded-Proto when constructing URLs (#105)

dependabot/npm_and_yarn/web/prismjs-1.21.0
memory 8 years ago
committed by Max Schmitt
parent
commit
45a128713c
  1. 2
      handlers/public.go

2
handlers/public.go

@ -197,7 +197,7 @@ func (h *Handler) handleDelete(c *gin.Context) {
func (h *Handler) getURLOrigin(c *gin.Context) string { func (h *Handler) getURLOrigin(c *gin.Context) string {
protocol := "http" protocol := "http"
if c.Request.TLS != nil || util.GetConfig().UseSSL { if c.Request.TLS != nil || c.GetHeader("X-Forwarded-Proto") == "https" || util.GetConfig().UseSSL {
protocol = "https" protocol = "https"
} }
return fmt.Sprintf("%s://%s", protocol, c.Request.Host) return fmt.Sprintf("%s://%s", protocol, c.Request.Host)

Loading…
Cancel
Save