-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return properly encoded URLs from JarResource#getResourceURL() #15360
Conversation
The failures are these (and look unrelated):
and this one on Windows:
I'll take a look at the PackageIT test later today to see if it's related to the change in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproducer from #15358 now passes
Fixes #15358
The commit here fixes the issue reported in #15358. The change involves, using the
URI
constructor to first properly encode (any special characters in) the resource name and then use theURI.toURL()
to allow for the encoded path part to be used in the newly constructed URL.This also include a test case which reproduces this issue and verifies the fix.
P.S: The test uses some special characters for directory and file names. These characters work fine on Linux, but I don't know if they are all allowed on Windows. So if this test case does indeed fail on Windows while trying to create a file or a directory, I will modify the test case to have it run only on *nix and maybe come up with some other characters for the file/directory for Windows.