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

@@ -54,14 +54,14 @@ public class PrefixResourceResolverTests {
public void resolveResource() {
String resourceId = "foo.css";
Resource expected = new ClassPathResource("test/foo.css", getClass());
Resource actual = this.chain.resolveResource(null, "/" + this.shaPrefix + "/" + resourceId, this.locations);
Resource actual = this.chain.resolveResource(null, this.shaPrefix + "/" + resourceId, this.locations);
assertEquals(expected, actual);
}
@Test
public void resolvePublicUrlPath() {
String resourceId = "/foo.css";
String url = "/" + this.shaPrefix + resourceId;
String url = this.shaPrefix + resourceId;
assertEquals(url, chain.resolvePublicUrlPath(resourceId, locations));
}