httpbuilder icon indicating copy to clipboard operation
httpbuilder copied to clipboard

Incorrect encoding of "+" in the query part

Open lucasvo opened this issue 12 years ago • 0 comments

When using RESTClient.get(...) it doesn't handle strings containing a + sign properly in query param. I have tracked it back to https://github.com/jgritman/httpbuilder/blob/master/src/main/java/groovyx/net/http/URIBuilder.java#L219 where for some reason it doesn't encode the "+" which it should.

Apache URIUtil has three method for this: encodeWithinQuery, encodeWithinAuthority, encodeWithinPath

URIUtil.encodeWithinQuery("+")
returns "%2B"

lucasvo avatar Dec 04 '13 21:12 lucasvo