SWF-566 Make org.springframework.js.resource.ResourceServlet more reusable
setAllowedResourcePaths now accepts a comma separated String instead of String[]. This has better compatibility with HttpServletBean. Added support for Ant style wildcard compressed mime types. "text/*" is now the default. This property is configurable with setCompressedMimeType, accepting a comma separated String.
This commit is contained in:
@@ -36,6 +36,7 @@ public class ResourceServletTests extends TestCase {
|
||||
servlet.doGet(request, response);
|
||||
|
||||
assertEquals(200, response.getStatus());
|
||||
assertNull(response.getHeader("Content-Encoding"));
|
||||
}
|
||||
|
||||
public final void testExecute_CombinedResources() throws Exception {
|
||||
@@ -50,6 +51,17 @@ public class ResourceServletTests extends TestCase {
|
||||
assertEquals(200, response.getStatus());
|
||||
}
|
||||
|
||||
public final void testExecute_CompressedResponse() throws Exception {
|
||||
|
||||
String requestPath = "/dojo/dojo.js";
|
||||
request.setPathInfo(requestPath);
|
||||
request.addHeader("Accept-Encoding", "gzip");
|
||||
servlet.doGet(request, response);
|
||||
|
||||
assertEquals(200, response.getStatus());
|
||||
assertEquals("gzip", response.getHeader("Content-Encoding"));
|
||||
}
|
||||
|
||||
public final void testExecute_ResourceNotFound() throws Exception {
|
||||
|
||||
String requestPath = "/xxx/xxx.js";
|
||||
|
||||
Reference in New Issue
Block a user