-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
ResourceHandlers cannot resolve static resources with certain wildcard patterns #29712
Comments
Your code snippet is missing critical information that we need to better understand this case. This doesn't show the resource handling URL pattern nor the request performed. Could you share a sample application that reproduces the issue? Ideally, an application generated from start.spring.io, containing a single resource handling registration and a single resource. Thanks! |
This is already a Github hosted Project: Calcmaster It is as simple as possible because with this Sample I will demonstrate the possibility to serve an Angular Frontend Application by a Spring Boot Application. By calling the URL /en/index.html you will see that all Javascript Libraries will result in a HTTP 404 (unfortunatly the used hash will depend on the Machine where the Code will be built why I use the pattern |
Sorry but there's too much going on there: multi-modules project, docker compose, angular application... |
I just made a simpler Sample which is still a multi-module Maven Project but with a precompiled Angular Application. And I removed everything else (Docker Compose, other Maven Plugins, ...) |
Thanks for the sample, I've reduced this to the following:
This is a bug in Spring Framework, I'm transferring the issue as a result. To be more precise the issue only happens when getting the path within the handler mapping and the mapping itself contains a |
Prior to this commit, extracting the path within handler mapping would result in "" if the matching path element would be a Regex and contain ".*". This could cause issues with resource handling if the handler mapping pattern was similar to `"/folder/file.*.extension"`. This commit introduces a new `isLiteral()` method in the `PathElement` abstract class that expresses whether the path element can be compared as a String for path matching or if it requires a more elaborate matching process. Using this method for extracting the path within handler mapping avoids relying on wildcard count or other properties. See gh-29712 Fixes gh-29716
Bug report
The following Code Snippet worked perfectly within Spring Boot 2.7.6
Unfortunatly for Spring Boot 3.0.0 all Wildcard Resources (i.e. main.b35ffcc13cda91f0.js) wouldn't be served. Instead it will result in a HTTP 404 (Not Found).
The text was updated successfully, but these errors were encountered: