medialize / URI.js

Javascript URL mutation library
http://medialize.github.io/URI.js/
MIT License
6.26k stars 474 forks source link

setSearch() breaks previous url parameters #396

Open Itazulay opened 4 years ago

Itazulay commented 4 years ago
var myUri = new URI("https://google.com/a?b=c&d=e,f,g")
myUri.toString() // "https://google.com/a?b=c&d=e,f,g"
myUri.setSearch("new", "value")
myUri.toString() // "https://google.com/a?b=c&d=e%2Cf%2Cg&new=value"

Apparently during the buildQueryParameter functionality, we encode each parameter value thus causing ',' value to be encoded and not its original value