mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Fix PrefixResourceResolver implementation
The configured prefix should not begin with a "/", since PublicResourceUrlProvider is already taking path mapping into account when resolving resources and URLs.
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ public class PrefixResourceResolver extends AbstractResourceResolver {
|
||||
|
||||
public PrefixResourceResolver(String prefix) {
|
||||
Assert.hasText(prefix, "prefix must not be null or empty");
|
||||
this.prefix = prefix.startsWith("/") ? prefix : "/" + prefix;
|
||||
this.prefix = prefix.startsWith("/") ? prefix.substring(1) : prefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user