RickWong/fetch-plus

Query URIEncoded twice

denis-mludek opened this issue · 1 comments

Hi,

Whenever I pass a text query with spaces, the spaces are replaced with %2520 instead of %20, am I doing something wrong here ?

let q = 'test fetch plus'  
endpoint.browse(
      URI,
      {query: {q}}
    )

Request query result : &q=test%2520fetch%2520plus

Thanks @denis-mludek I found the problem. The query-string package already handles encoding, so it's indeed encoding twice on this line:

query = "?" + encodeURI(queryString.stringify(computeObject(query)));

Will publish fix tomorrow.