From e3270fefb2fe13a9db6f120c2ed19883777fd056 Mon Sep 17 00:00:00 2001 From: Pavel Zavora Date: Tue, 24 Nov 2020 20:24:44 +0100 Subject: [PATCH] feat(v2): modify flux proxy to add org parameter to /api/v2/query --- server/flux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/flux.go b/server/flux.go index 1994b400c..287b657df 100644 --- a/server/flux.go +++ b/server/flux.go @@ -176,6 +176,11 @@ func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request) { director := func(req *http.Request) { // Set the Host header of the original Flux URL req.Host = u.Host + // Add v2-required org parameter + query := u.Query() + query.Add("org", src.Username) // v2 organization name is stored as v1 username + u.RawQuery = query.Encode() + // Set URL req.URL = u // Use authorization method based on whether it is OSS or Enterprise