mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Add Content-Type to allowed headers for CloudFoundry actuators
See gh-7108
This commit is contained in:
parent
2930bd4145
commit
2697bf2ba1
@ -90,8 +90,8 @@ public class CloudFoundryActuatorAutoConfiguration {
|
||||
corsConfiguration.addAllowedOrigin(CorsConfiguration.ALL);
|
||||
corsConfiguration.setAllowedMethods(
|
||||
Arrays.asList(HttpMethod.GET.name(), HttpMethod.POST.name()));
|
||||
corsConfiguration
|
||||
.setAllowedHeaders(Arrays.asList("Authorization", "X-Cf-App-Instance"));
|
||||
corsConfiguration.setAllowedHeaders(
|
||||
Arrays.asList("Authorization", "X-Cf-App-Instance", "Content-Type"));
|
||||
return corsConfiguration;
|
||||
}
|
||||
|
||||
|
@ -82,10 +82,10 @@ public class CloudFoundryActuatorAutoConfigurationTests {
|
||||
CorsConfiguration corsConfiguration = (CorsConfiguration) ReflectionTestUtils
|
||||
.getField(handlerMapping, "corsConfiguration");
|
||||
assertThat(corsConfiguration.getAllowedOrigins()).contains("*");
|
||||
assertThat(corsConfiguration.getAllowedMethods()).contains(HttpMethod.GET.name(),
|
||||
HttpMethod.POST.name());
|
||||
assertThat(corsConfiguration.getAllowedHeaders()
|
||||
.containsAll(Arrays.asList("Authorization", "X-Cf-App-Instance")));
|
||||
assertThat(corsConfiguration.getAllowedMethods()).containsAll(
|
||||
Arrays.asList(HttpMethod.GET.name(), HttpMethod.POST.name()));
|
||||
assertThat(corsConfiguration.getAllowedHeaders()).containsAll(
|
||||
Arrays.asList("Authorization", "X-Cf-App-Instance", "Content-Type"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user