From 21eac9a417888cb270c1c26e40db9e3be5f5f4b6 Mon Sep 17 00:00:00 2001 From: Raymond Yang Date: Mon, 26 Jun 2023 20:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ECORS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/com/ray650128/pcredive/plugins/HTTP.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ray650128/pcredive/plugins/HTTP.kt b/src/main/kotlin/com/ray650128/pcredive/plugins/HTTP.kt index aee5e75..02b27ff 100644 --- a/src/main/kotlin/com/ray650128/pcredive/plugins/HTTP.kt +++ b/src/main/kotlin/com/ray650128/pcredive/plugins/HTTP.kt @@ -11,7 +11,9 @@ fun Application.configureHTTP() { allowMethod(HttpMethod.Delete) allowMethod(HttpMethod.Patch) allowHeader(HttpHeaders.Authorization) - allowHeader("MyCustomHeader") - anyHost() // @TODO: Don't do this in production if possible. Try to limit it. + allowHeader(HttpHeaders.AccessControlAllowOrigin) + anyHost() + allowCredentials = true + allowNonSimpleContentTypes = true } }