You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.3 KiB
26 lines
1.3 KiB
diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilterTests.java |
|
index e94a2a6..5b67c58 100644 |
|
--- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilterTests.java |
|
+++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlEncodingFilterTests.java |
|
@@ -89,6 +89,21 @@ public class ResourceUrlEncodingFilterTests { |
|
}); |
|
} |
|
|
|
+ // SPR-13757 |
|
+ @Test |
|
+ public void encodeURLAtContextPath() throws Exception { |
|
+ MockHttpServletRequest request = new MockHttpServletRequest("GET", "/context"); |
|
+ request.setContextPath("/context"); |
|
+ request.setAttribute(ResourceUrlProviderExposingInterceptor.RESOURCE_URL_PROVIDER_ATTR, this.resourceUrlProvider); |
|
+ MockHttpServletResponse response = new MockHttpServletResponse(); |
|
+ |
|
+ this.filter.doFilterInternal(request, response, (request1, response1) -> { |
|
+ String result = ((HttpServletResponse) response1).encodeURL("/context/resources/bar.css"); |
|
+ assertEquals("/context/resources/bar-11e16cf79faee7ac698c805cf28248d2.css", result); |
|
+ }); |
|
+ } |
|
+ |
|
+ |
|
// SPR-13018 |
|
@Test |
|
public void encodeEmptyURLWithContext() throws Exception {
|
|
|