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:
Rossen Stoyanchev
2016-01-25 16:32:22 -05:00
parent 319e8e2c2f
commit 2607a22537
7 changed files with 18 additions and 21 deletions

View File

@@ -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"));
}
}

View File

@@ -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");
}

View File

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