Switch disallowedMethods test to use PATCH

Update the requestsWithDisallowedMethodsAreRejected test to use PATCH
rather than HEAD. The change is to allow support for Spring Framework
4.3 which will implicitly map HEAD requests to GET.

Pre-flight requests are also only for "non-simple" HTTP methods [1]
(i.e. anything but GET, HEAD, POST) so there is really no such a thing
as a pre-flight request for HEAD.

[1] https://www.w3.org/TR/cors/#resource-preflight-requests
This commit is contained in:
Phillip Webb 2016-02-19 22:10:40 -08:00
parent 89b7704977
commit 602a09332d
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ public class MvcEndpointCorsIntegrationTests {
"endpoints.cors.allowed-origins:foo.example.com");
createMockMvc()
.perform(options("/health").header(HttpHeaders.ORIGIN, "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "HEAD"))
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH"))
.andExpect(status().isForbidden());
}