Skip to content

Commit

Permalink
use https if proxied
Browse files Browse the repository at this point in the history
  • Loading branch information
swills committed Feb 18, 2025
1 parent 1ac9228 commit ad0ee0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/proxy/actions/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func proxyHomeHandler(c *config.Config) http.HandlerFunc {

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

0 comments on commit ad0ee0f

Please sign in to comment.