DATAREST-1581 - Fixed CORS defaults to include all HTTP methods exposed by Spring Data REST.

The fix for DATAREST-1535 has changed the default allowed methods for CORS requests to a smaller set than we originally returned. This commit reinstantiates the default to be set to all HTTP methods, Spring Data repositories support by default.

Related tickets: DATAREST-1535.
This commit is contained in:
Oliver Drotbohm
2020-12-01 22:21:22 +01:00
parent 328ea26244
commit 38f2bc4598
4 changed files with 52 additions and 8 deletions

View File

@@ -64,7 +64,9 @@ public class RepositoryCorsConfigurationAccessorUnitTests {
assertThat(configuration.getAllowCredentials()).isNull();
assertThat(configuration.getAllowedHeaders()).contains("*");
assertThat(configuration.getAllowedOrigins()).contains("*");
assertThat(configuration.getAllowedMethods()).contains("HEAD", "GET", "POST");
assertThat(configuration.getAllowedMethods())
.contains("HEAD", "GET", "POST", "PUT", "PATCH", "OPTIONS")
.doesNotContain("TRACE");
assertThat(configuration.getMaxAge()).isEqualTo(1800L);
}