|
@@ -21,11 +21,11 @@ class ZenCorsPathMatchingFilter : PathMatchingFilter() {
|
|
httpResponse.apply {
|
|
httpResponse.apply {
|
|
setHeader("Access-control-Allow-Origin", httpRequest.getHeader("Origin"))
|
|
setHeader("Access-control-Allow-Origin", httpRequest.getHeader("Origin"))
|
|
setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH")
|
|
setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH")
|
|
- addHeader("Access-Control-Allow-Credentials", "true")
|
|
|
|
|
|
+ setHeader("Access-Control-Allow-Credentials", "true")
|
|
setHeader("Access-Control-Allow-Headers", httpRequest.getHeader("Access-Control-Request-Headers"))
|
|
setHeader("Access-Control-Allow-Headers", httpRequest.getHeader("Access-Control-Request-Headers"))
|
|
val method = HttpMethod.valueOf(httpRequest.method)
|
|
val method = HttpMethod.valueOf(httpRequest.method)
|
|
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
|
|
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
|
|
- addHeader("Access-Control-Expose-Headers", "Location")
|
|
|
|
|
|
+ setHeader("Access-Control-Expose-Headers", "Location")
|
|
} else if (method == HttpMethod.OPTIONS) {
|
|
} else if (method == HttpMethod.OPTIONS) {
|
|
status = HttpStatus.OK.value()
|
|
status = HttpStatus.OK.value()
|
|
}
|
|
}
|