-
Notifications
You must be signed in to change notification settings - Fork 38.9k
When no API version is provided, static resources fail to load #36059
Copy link
Copy link
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
I am experimenting with the API Versioning feature introduced in Spring 7.
I have an image file named foo.png under the resources/static directory.
However, when I try to access http://localhost:8080/foo.png in the browser, the image cannot be loaded.
In my case, the HandlerMappings are evaluated in the following order:
RouterFunctionMapping(withApiVersionStrategy)RequestMappingHandlerMapping(withApiVersionStrategy)WelcomePageHandlerMappingBeanNameUrlHandlerMappingWelcomePageNotAcceptableHandlerMappingSimpleUrlHandlerMapping
I expect the image resource to be handled by SimpleUrlHandlerMapping. However, due to the ordering, the request fails earlier in the initApiVersion(HttpServletRequest) method of RouterFunctionMapping.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement