HTTP OPTIONS lists all HTTP methods except TRACE
This is in line with the current behavior of HttpServlet that would have been in used with dispatchOptionsRequest on the DispatcherSerlvet set to false (the default prior to 4.3). Issue: SPR-13130
This commit is contained in:
@@ -77,7 +77,7 @@ public class ParameterizableViewControllerTests {
|
||||
ModelAndView mav = this.controller.handleRequest(this.request, response);
|
||||
|
||||
assertNull(mav);
|
||||
assertEquals("GET,HEAD", response.getHeader("Allow"));
|
||||
assertEquals("GET,HEAD,OPTIONS", response.getHeader("Allow"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class RequestMappingInfoHandlerMappingTests {
|
||||
public void getHandlerHttpOptions() throws Exception {
|
||||
testHttpOptions("/foo", "GET,HEAD");
|
||||
testHttpOptions("/person/1", "PUT");
|
||||
testHttpOptions("/persons", "GET,HEAD");
|
||||
testHttpOptions("/persons", "GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS");
|
||||
testHttpOptions("/something", "PUT,POST");
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ResourceHttpRequestHandlerTests {
|
||||
this.handler.handleRequest(this.request, this.response);
|
||||
|
||||
assertEquals(200, this.response.getStatus());
|
||||
assertEquals("GET,HEAD", this.response.getHeader("Allow"));
|
||||
assertEquals("GET,HEAD,OPTIONS", this.response.getHeader("Allow"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user