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:
Brian Clozel
2014-04-24 14:43:26 +02:00
parent bded025d9f
commit c4843577ba
2 changed files with 3 additions and 3 deletions

View File

@@ -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