-
Notifications
You must be signed in to change notification settings - Fork 41.6k
fix missing trailing slash in spring.resources.static-locations #9360
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
Conversation
@szantopeter Can you provide a bit more background on why the existing code isn't working for you? Do you have a sample application you can share that shows the problem? |
|
@philwebb I created a sample here https://github.com/szantopeter/spring-boot-static-locations There are two tests, both should pass, but one fails. The only difference between them is a trailing slash |
|
Thanks. |
|
We might be able to shift that logic to |
|
@szantopeter Thanks very much for the PR. As suggested by @philwebb, we've taken a slightly different approach to fixing the problem. Please see ad62905 for details. |
|
@wilkinsona it took me some efforts to identify the bug and find the solution so I was hoping that I will have a commit in Spring Boot, but apart from that final solution is good as well! |
|
@szantopeter Sorry. We would normally have taken a bit more time to give you a chance to make the suggested updates but we're trying to finish off 1.5.4 which is due on Thursday. Please don't misinterpret the PR not being merged as us not appreciating your efforts. |
If the value of
spring.resources.static-locationsis not ending with a trailing slash then no resources are loaded from the specified folder. The current code already provided a solution for adding a trailing slash, but that processing was done in the wrong place, so I moved it to a location where it really takes effect.