Skip to content

Commit

Permalink
feat: option to set URL query params without encoding #797
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Oct 10, 2024
1 parent d208cec commit 87ce973
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ func parseRequestURL(c *Client, r *Request) error {

// GH#797 Unescape query parameters
if r.unescapeQueryParams && len(reqURL.RawQuery) > 0 {
unescapedQuery, err := url.QueryUnescape(reqURL.RawQuery)
if err != nil {
return err
}
// at this point, all errors caught up in the above operations
// so ignore the return error on query unescape; I realized
// while writing the unit test
unescapedQuery, _ := url.QueryUnescape(reqURL.RawQuery)
reqURL.RawQuery = strings.ReplaceAll(unescapedQuery, " ", "+") // otherwise request becomes bad request
}

Expand Down

0 comments on commit 87ce973

Please sign in to comment.