-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
ResourceHttpRequestHandler fails to resolve encoded paths when PathPattern is used #26775
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Apr 7, 2021
Uploading the full jar file which includes the nested resources jar. The original app is from https://github.com/spring-projects/spring-boot/blob/master/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/example/ResourceHandlingApplication.java and is updated dynamically as we test a number of different servlet containers. |
rstoyanchev
added
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Apr 8, 2021
rstoyanchev
added a commit
that referenced
this issue
Apr 12, 2021
jhoeller
added a commit
that referenced
this issue
Apr 13, 2021
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See spring-projects/spring-boot#24805 and #26445
When working with the classic ant path matcher
ResourceHttpRequestHandler
will resolve resources in folders that have encoded characters. When switching toPathPattern
, this fails.The reason appears to a difference with the value stored in
HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
. With the ant matcher this line returns a path that's decoded. With thePathPattern
it returns to original encoded form.The attached application will replicate the issue. Calling
curl http://localhost:8080/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt
will work ifant-path-matcher
is set in theapplication.yml
but fail when it'spath-pattern-parser
.app.zip
The text was updated successfully, but these errors were encountered: