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

This commit is contained in:
memory 2018-05-18 20:36:41 -04:00 committed by Max Schmitt
parent fab091d75a
commit 45a128713c
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ func (h *Handler) handleDelete(c *gin.Context) {
func (h *Handler) getURLOrigin(c *gin.Context) string {
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"
}
return fmt.Sprintf("%s://%s", protocol, c.Request.Host)