新增CORS
This commit is contained in:
parent
24f7726727
commit
21eac9a417
@ -11,7 +11,9 @@ fun Application.configureHTTP() {
|
|||||||
allowMethod(HttpMethod.Delete)
|
allowMethod(HttpMethod.Delete)
|
||||||
allowMethod(HttpMethod.Patch)
|
allowMethod(HttpMethod.Patch)
|
||||||
allowHeader(HttpHeaders.Authorization)
|
allowHeader(HttpHeaders.Authorization)
|
||||||
allowHeader("MyCustomHeader")
|
allowHeader(HttpHeaders.AccessControlAllowOrigin)
|
||||||
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
anyHost()
|
||||||
|
allowCredentials = true
|
||||||
|
allowNonSimpleContentTypes = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user