Skip to content

Commit 8e313b6

Browse files
authored
use https if proxied (#2033)
1 parent 341bf97 commit 8e313b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/proxy/actions/home.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func proxyHomeHandler(c *config.Config) http.HandlerFunc {
116116

117117
// if the host does not have a scheme, add one based on the request
118118
if !strings.HasPrefix(templateData["Host"], "http://") && !strings.HasPrefix(templateData["Host"], "https://") {
119-
if r.TLS != nil {
119+
if r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https" {
120120
templateData["Host"] = "https://" + templateData["Host"]
121121
} else {
122122
templateData["Host"] = "http://" + templateData["Host"]

0 commit comments

Comments
 (0)