Skip to content

ResourceHttpRequestHandler fails to resolve encoded paths when PathPattern is used #26775

@philwebb

Description

@philwebb

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 to PathPattern, 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 the PathPattern 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 if ant-path-matcher is set in the application.yml but fail when it's path-pattern-parser.

app.zip

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions