-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty 12 : More testing for Resource alias #8436
Jetty 12 : More testing for Resource alias #8436
Conversation
I need more test cases! What is a combination of ..
|
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java
Show resolved
Hide resolved
+ Closing ResourceFactory where appropriate + new internal to zipfs Symlink test
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Outdated
Show resolved
Hide resolved
PathResource.checkAliasPath
to handle jar:file:
paths more elegantly…pathresource-alias-detection-in-jarfile
…pathresource-alias-detection-in-jarfile
…pathresource-alias-detection-in-jarfile
…f github.com:eclipse/jetty.project into fix/jetty-12-pathresource-alias-detection-in-jarfile
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.
A few things need fixing.
Overall, I'm really concerned about the amount of garbage that we are going to create as we frequently convert between Strings, URIs and Paths, then make corrected versions of them then throw them away. But let's go for correctness first I guess.
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Outdated
Show resolved
Hide resolved
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.
Few tests are now failing.
If the resource is an alias using Resource.getPath()
will throw NoSuchFileException
when used, but the Resource.exists()
returns true. So everywhere it is used you would have to use a pattern like resource.isAlias() ? resource.getAlias() : resource.getPath()
, so maybe instead resource.getPath()
should return the alias path?
...y-core/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java
Outdated
Show resolved
Hide resolved
@joakime Can you look at the disabled test Is using
|
This is related to #8462 as well. |
…pathresource-alias-detection-in-jarfile
…pathresource-alias-detection-in-jarfile
Reworked the
PathResource.checkAliasPath
...If the URI is a
jar:file:
based, the URI only check is skipped and the path segment checks still apply.Also, the symlink check is skipped (as it's not possible to have symlinks in zipfs)