Add Content-Type to allowed headers for CloudFoundry actuators

See gh-7108
pull/7387/head
Madhura Bhave 8 years ago
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…
Cancel
Save