Skip to content

Commit

Permalink
feat: include query arguments from forwaded uri in url of decision re…
Browse files Browse the repository at this point in the history
…quest
  • Loading branch information
GaneshTILLX committed Aug 21, 2024
1 parent 6b5672b commit ab8bd27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/decision.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ func (h *DecisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next
r.URL.Scheme = x.OrDefaultString(r.Header.Get(xForwardedProto),
x.IfThenElseString(r.TLS != nil, "https", "http"))
r.URL.Host = x.OrDefaultString(r.Header.Get(xForwardedHost), r.Host)
r.URL.Path = x.OrDefaultString(strings.SplitN(r.Header.Get(xForwardedUri), "?", 2)[0], r.URL.Path[len(DecisionPath):])

f := strings.SplitN(r.Header.Get(xForwardedUri), "?", 2)
r.URL.Path = x.OrDefaultString(f[0], r.URL.Path[len(DecisionPath):])
if len(f) == 2 {
r.URL.RawQuery = x.OrDefaultString(f[1], "")
}
h.decisions(w, r)
} else {
next(w, r)
Expand Down

0 comments on commit ab8bd27

Please sign in to comment.