Skip to content

Commit

Permalink
Remove extra query parameter name when calling sources using the gene…
Browse files Browse the repository at this point in the history
…rated code
  • Loading branch information
dehort committed Jan 20, 2024
1 parent eb37841 commit 3588aa5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/api/connectors/sources/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ func NewSourcesClientWithHttpRequestDoer(cfg *viper.Viper, doer HttpRequestDoer)
req.Header.Set(constants.HeaderIdentity, identity)
}

originalUrl := req.URL.String()
if strings.Contains(originalUrl, "filter=filter[") {

Check failure on line 37 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / lint

undefined: strings (typecheck)

Check failure on line 37 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / golang

undefined: strings
// Remove the extra filter parameter name
correctedUrl := strings.Replace(req.URL.String(), "filter=", "", -1)

Check failure on line 39 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / lint

undefined: strings (typecheck)

Check failure on line 39 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / golang

undefined: strings

newUrl, err := url.Parse(correctedUrl)

Check failure on line 41 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / lint

undefined: url (typecheck)

Check failure on line 41 in internal/api/connectors/sources/impl.go

View workflow job for this annotation

GitHub Actions / golang

undefined: url
if err != nil {
return err
}

req.URL = newUrl
}

return nil
},
},
Expand Down

0 comments on commit 3588aa5

Please sign in to comment.