From 734fb7a49df531ed20623b6d3ba56a983f1d9d13 Mon Sep 17 00:00:00 2001 From: Derek Horton Date: Mon, 22 Jan 2024 10:12:49 -0600 Subject: [PATCH] Sources returns a 400 if the equal is url encoded --- internal/api/connectors/sources/impl.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/api/connectors/sources/impl.go b/internal/api/connectors/sources/impl.go index 804653a2..11f47764 100644 --- a/internal/api/connectors/sources/impl.go +++ b/internal/api/connectors/sources/impl.go @@ -38,9 +38,12 @@ func NewSourcesClientWithHttpRequestDoer(cfg *viper.Viper, doer HttpRequestDoer) originalUrl := req.URL.String() if strings.Contains(originalUrl, "filter=filter%5B") { // Remove the extra filter parameter name - correctedUrl := strings.Replace(req.URL.String(), "filter=", "", -1) + urlWithExtraFilterRemoved := strings.Replace(req.URL.String(), "filter=", "", -1) - newUrl, err := url.Parse(correctedUrl) + // Convert the url encoded "=" to unencoded "=" for...otherwise sources returns a 400 + urlWithEqualUnencoded := strings.Replace(urlWithExtraFilterRemoved, "%3D", "=", -1) + + newUrl, err := url.Parse(urlWithEqualUnencoded) if err != nil { return err }