From 602a09332d147218f524f1300a5bde1aafba4ad0 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 19 Feb 2016 22:10:40 -0800 Subject: [PATCH] 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 --- .../actuate/endpoint/mvc/MvcEndpointCorsIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpointCorsIntegrationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpointCorsIntegrationTests.java index 3a4d34cc1ea..8d21856551e 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpointCorsIntegrationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpointCorsIntegrationTests.java @@ -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()); }