Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Commit 45a1287

Browse files
memorymxschmitt
authored andcommitted
Look for X-Forwarded-Proto when constructing URLs (#105)
1 parent fab091d commit 45a1287

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handlers/public.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (h *Handler) handleDelete(c *gin.Context) {
197197

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

0 commit comments

Comments
 (0)