You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit 45ed002 fixes the bug #1873 by automatically encoding URL when HttpConnection.connect(String) or Jsoup.connect(String) is used.
This encodes already-properly encoded URL and break them. Example: I want to call JSoup on https://example.com/api with a parameter callback which value is https://callback.url:12345/call/me/back. This value must be encoded.
Before, I was able to properly handle parameter encoding on my side and do:
From my point of view, the #1874 "fix" should be reverted, as this is not the role of the underlying library (here Jsoup) do to some kind of magic with bad input parameter. Jsoup should reject properly URL without encoded parameter and let the user to handle this correctly.
Also, this was a breaking change, and for semver’s sake, there should not be breaking changes on "patch" version.
Workarounds:
Remove proper URL encoding on URL given to JSoup as String (… seriously).
Use the URL methods (as HttpConnection.connect(URL)) that doesn’t suffer from this double URLencoding bug.
The text was updated successfully, but these errors were encountered:
This commit 45ed002 fixes the bug #1873 by automatically encoding URL when
HttpConnection.connect(String)
orJsoup.connect(String)
is used.This encodes already-properly encoded URL and break them. Example: I want to call JSoup on
https://example.com/api
with a parametercallback
which value ishttps://callback.url:12345/call/me/back
. This value must be encoded.Before, I was able to properly handle parameter encoding on my side and do:
And everything worked fine.
Since 1.15.4, this code forces another layer of encoding on top on my encoding, and the URL called is:
https://example.com/api?callback=https%253A%252F%252Fcallback.url%253A12345%252Fcall%252Fme%252Fback%0A
Which obviously don’t work.
From my point of view, the #1874 "fix" should be reverted, as this is not the role of the underlying library (here Jsoup) do to some kind of magic with bad input parameter. Jsoup should reject properly URL without encoded parameter and let the user to handle this correctly.
Also, this was a breaking change, and for semver’s sake, there should not be breaking changes on "patch" version.
Workarounds:
String
(… seriously).URL
methods (asHttpConnection.connect(URL)
) that doesn’t suffer from this double URLencoding bug.The text was updated successfully, but these errors were encountered: