Skip to content

Commit a539492

Browse files
pristalovpavelJSMonk
authored andcommitted
Update Server.kt
This string allows you, for example, upload your app to Heroku while you DB is in MongoDB Atlas. In this case CORS blocks your POST requests. See https://youtrack.jetbrains.com/issue/KTOR-4008/POST-request-to-database-returns-403-error#focus=Comments-27-6434385.0-0
1 parent cec57d3 commit a539492

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jvmMain/kotlin/Server.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fun main() {
3030
json()
3131
}
3232
install(CORS) {
33+
allowHeader(HttpHeaders.ContentType)
3334
allowMethod(HttpMethod.Get)
3435
allowMethod(HttpMethod.Post)
3536
allowMethod(HttpMethod.Delete)
@@ -65,4 +66,4 @@ fun main() {
6566
}
6667
}
6768
}.start(wait = true)
68-
}
69+
}

0 commit comments

Comments
 (0)