Encode spaces as %20 rather than + in URL params#916
Encode spaces as %20 rather than + in URL params#916KostyaSha merged 1 commit intodocker-java:3.0.xfrom orzeh:space_url_encoding
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.0.x #916 +/- ##
==========================================
+ Coverage 71.72% 71.75% +0.02%
==========================================
Files 306 306
Lines 6878 6878
Branches 516 516
==========================================
+ Hits 4933 4935 +2
+ Misses 1646 1645 -1
+ Partials 299 298 -1
Continue to review full report at Codecov.
|
|
Is it only jersey issue or netty also? Afair they have very different encoders internals |
| try { | ||
| return webTarget.queryParam(name, | ||
| URLEncoder.encode(MAPPER.writeValueAsString(value), "UTF-8")); | ||
| URLEncoder.encode(MAPPER.writeValueAsString(value), "UTF-8").replaceAll("\\+", "%20")); |
There was a problem hiding this comment.
afair commons has EscapeUtils that may do this with few other chars.
There was a problem hiding this comment.
AFAIK EscapeUtils escapes only HTML entities. Commons Lang provides URLCodec which basically behaves the same as URLEncoder (space is converted to +).
|
This issue affects jersey implementation only, however I've added some special chars in both tests to be sure. |
|
com.google.common.net.UrlEscapers is also escaping to plus, maybe it bug in docker? |
|
Let's check what else PRs are critical and i will do release. |
|
Was this included in the 3.0.13 release? |
|
Ok so it hasn't gone in yet I presume. The next point release should then pick this up. |
|
#903 that's is waiting... |
|
Gotcha. Thanks |
Java
URLEncoderwill replace spaces with+but it seems that Docker expects all URL parameters to be encoded using%XY.This PR will fix gradle-docker-plugin issue.
This change is