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.addAllowedOrigin(CorsConfiguration.ALL);
|
||||||
corsConfiguration.setAllowedMethods(
|
corsConfiguration.setAllowedMethods(
|
||||||
Arrays.asList(HttpMethod.GET.name(), HttpMethod.POST.name()));
|
Arrays.asList(HttpMethod.GET.name(), HttpMethod.POST.name()));
|
||||||
corsConfiguration
|
corsConfiguration.setAllowedHeaders(
|
||||||
.setAllowedHeaders(Arrays.asList("Authorization", "X-Cf-App-Instance"));
|
Arrays.asList("Authorization", "X-Cf-App-Instance", "Content-Type"));
|
||||||
return corsConfiguration;
|
return corsConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,10 @@ public class CloudFoundryActuatorAutoConfigurationTests {
|
||||||
CorsConfiguration corsConfiguration = (CorsConfiguration) ReflectionTestUtils
|
CorsConfiguration corsConfiguration = (CorsConfiguration) ReflectionTestUtils
|
||||||
.getField(handlerMapping, "corsConfiguration");
|
.getField(handlerMapping, "corsConfiguration");
|
||||||
assertThat(corsConfiguration.getAllowedOrigins()).contains("*");
|
assertThat(corsConfiguration.getAllowedOrigins()).contains("*");
|
||||||
assertThat(corsConfiguration.getAllowedMethods()).contains(HttpMethod.GET.name(),
|
assertThat(corsConfiguration.getAllowedMethods()).containsAll(
|
||||||
HttpMethod.POST.name());
|
Arrays.asList(HttpMethod.GET.name(), HttpMethod.POST.name()));
|
||||||
assertThat(corsConfiguration.getAllowedHeaders()
|
assertThat(corsConfiguration.getAllowedHeaders()).containsAll(
|
||||||
.containsAll(Arrays.asList("Authorization", "X-Cf-App-Instance")));
|
Arrays.asList("Authorization", "X-Cf-App-Instance", "Content-Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue