Commit 602a0933 authored by Phillip Webb's avatar Phillip Webb

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
parent 89b77049
...@@ -127,7 +127,7 @@ public class MvcEndpointCorsIntegrationTests { ...@@ -127,7 +127,7 @@ public class MvcEndpointCorsIntegrationTests {
"endpoints.cors.allowed-origins:foo.example.com"); "endpoints.cors.allowed-origins:foo.example.com");
createMockMvc() createMockMvc()
.perform(options("/health").header(HttpHeaders.ORIGIN, "foo.example.com") .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()); .andExpect(status().isForbidden());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment