From ab8bd2711f204db38100e1cce462c86a8063ef9b Mon Sep 17 00:00:00 2001 From: Ganeshkumar Date: Wed, 21 Aug 2024 14:23:29 +1000 Subject: [PATCH] feat: include query arguments from forwaded uri in url of decision request --- api/decision.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/decision.go b/api/decision.go index d1cfbb37dd..6895c003d5 100644 --- a/api/decision.go +++ b/api/decision.go @@ -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)