You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
513 B
19 lines
513 B
package cool.kirito.bili.live.server.plugins
|
|
|
|
import io.ktor.application.*
|
|
import io.ktor.features.*
|
|
import io.ktor.http.*
|
|
|
|
fun Application.configureHTTP() {
|
|
install(CORS) {
|
|
method(HttpMethod.Options)
|
|
method(HttpMethod.Put)
|
|
method(HttpMethod.Delete)
|
|
method(HttpMethod.Patch)
|
|
header(HttpHeaders.Authorization)
|
|
header("MyCustomHeader")
|
|
allowCredentials = true
|
|
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
|
}
|
|
|
|
}
|
|
|