Skip to content

Commit

Permalink
fix: add support for X-Forwarded-Proto header (#638)
Browse files Browse the repository at this point in the history
Closes #153
  • Loading branch information
christian-roggia authored Feb 15, 2021
1 parent 19fa7a5 commit 6eb83fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/decision.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (h *DecisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next
if len(r.URL.Path) >= len(DecisionPath) && r.URL.Path[:len(DecisionPath)] == DecisionPath {
r.URL.Scheme = "http"
r.URL.Host = r.Host
if r.TLS != nil {
if r.TLS != nil || strings.EqualFold(r.Header.Get("X-Forwarded-Proto"), "https") {
r.URL.Scheme = "https"
}
r.URL.Path = r.URL.Path[len(DecisionPath):]
Expand Down

0 comments on commit 6eb83fd

Please sign in to comment.