Add OPTIONS to list of allowed CORS methods
This commit is contained in:
parent
5efc9b2b3b
commit
59baf03e22
1 changed files with 7 additions and 2 deletions
|
@ -70,8 +70,13 @@ open class SecurityConfig(
|
||||||
with(CorsConfiguration()) {
|
with(CorsConfiguration()) {
|
||||||
applyPermitDefaultValues()
|
applyPermitDefaultValues()
|
||||||
allowedOrigins = environment["twigs.cors.domains"]?.split(",") ?: listOf("*")
|
allowedOrigins = environment["twigs.cors.domains"]?.split(",") ?: listOf("*")
|
||||||
allowedMethods = listOf(HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE)
|
allowedMethods = listOf(
|
||||||
.map { it.name }
|
HttpMethod.GET,
|
||||||
|
HttpMethod.POST,
|
||||||
|
HttpMethod.PUT,
|
||||||
|
HttpMethod.DELETE,
|
||||||
|
HttpMethod.OPTIONS
|
||||||
|
).map { it.name }
|
||||||
allowCredentials = true
|
allowCredentials = true
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue