Update CORS handling according to Framework changes
This commit updates CORS handling according to Framework changes
introduced via [1]. It also fixes tests according to the new behavior.
See gh-16410
[1] d27b5d0ab6.
This commit is contained in:
committed by
Andy Wilkinson
parent
8ebe5f9983
commit
2f9db7eec6
@@ -63,8 +63,7 @@ public class WebFluxEndpointCorsIntegrationTests {
|
||||
createWebTestClient().options().uri("/actuator/beans")
|
||||
.header("Origin", "spring.example.org")
|
||||
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET").exchange()
|
||||
.expectStatus().isForbidden().expectHeader()
|
||||
.doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN);
|
||||
.expectHeader().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -138,7 +138,7 @@ public class WebMvcEndpointCorsIntegrationTests {
|
||||
.of("management.endpoints.web.cors.allowed-origins:foo.example.com")
|
||||
.applyTo(this.context);
|
||||
createMockMvc()
|
||||
.perform(options("/actuator/health")
|
||||
.perform(options("/actuator/beans")
|
||||
.header(HttpHeaders.ORIGIN, "foo.example.com")
|
||||
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH"))
|
||||
.andExpect(status().isForbidden());
|
||||
|
||||
Reference in New Issue
Block a user