調整CORS設定
This commit is contained in:
@@ -8,13 +8,20 @@ import io.ktor.server.routing.*
|
||||
|
||||
fun Application.configureHttp() {
|
||||
install(CORS) {
|
||||
allowHost("localhost:8080")
|
||||
allowHost("table.sakunadaisuki.club")
|
||||
|
||||
allowMethod(HttpMethod.Options)
|
||||
allowMethod(HttpMethod.Put)
|
||||
allowMethod(HttpMethod.Delete)
|
||||
allowMethod(HttpMethod.Patch)
|
||||
allowHeader(HttpHeaders.Authorization)
|
||||
|
||||
allowHeader(HttpHeaders.ContentType) // 處理 JSON 必備
|
||||
allowHeader(HttpHeaders.Authorization) // 傳遞 JWT / 身份驗證權限必備
|
||||
|
||||
allowHeader("MyCustomHeader")
|
||||
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
||||
//anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
||||
}
|
||||
routing {
|
||||
swaggerUI(path = "openapi") {
|
||||
|
||||
Reference in New Issue
Block a user