Skip to content

Commit b25cafa

Browse files
committed
fix: should fix preflight requests
1 parent ee12d2b commit b25cafa

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/kotlin/co/statu/parsek/config/ParsekConfig.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ data class ParsekConfig(
2121
"Content-Type",
2222
"accept",
2323
"X-PINGARUNER",
24-
"x-csrf-token"
24+
"x-csrf-token",
25+
"Authorization"
2526
),
2627
@SerializedName("allowed-methods") var allowedMethods: Set<String> = setOf(
2728
"GET", "POST", "OPTIONS", "DELETE", "PATCH", "PUT"

src/main/kotlin/co/statu/parsek/model/Route.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ abstract class Route {
5151
val headersAsString = headers.joinToString(",")
5252
ctx.response().putHeader("Access-Control-Allow-Headers", headersAsString)
5353

54+
// Set Access-Control-Allow-Credentials to true
55+
ctx.response().putHeader("Access-Control-Allow-Credentials", "true")
56+
5457
// If it's a Preflight (OPTIONS) request, end the response immediately:
5558
if (ctx.request().method() == HttpMethod.OPTIONS) {
5659
ctx.response().end()

0 commit comments

Comments
 (0)