Add support for CORS
This commit is contained in:
parent
58f1b1d373
commit
4bdcc90746
1 changed files with 25 additions and 0 deletions
|
@ -107,6 +107,31 @@ fun Application.moduleWithDependencies(
|
||||||
useArrayPolymorphism = true
|
useArrayPolymorphism = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
install(CORS) {
|
||||||
|
anyHost()
|
||||||
|
method(HttpMethod.Options)
|
||||||
|
method(HttpMethod.Put)
|
||||||
|
method(HttpMethod.Delete)
|
||||||
|
header(HttpHeaders.Authorization)
|
||||||
|
header(HttpHeaders.Accept)
|
||||||
|
header(HttpHeaders.AcceptEncoding)
|
||||||
|
header(HttpHeaders.AcceptLanguage)
|
||||||
|
header(HttpHeaders.Connection)
|
||||||
|
header(HttpHeaders.ContentType)
|
||||||
|
header(HttpHeaders.Host)
|
||||||
|
header(HttpHeaders.Origin)
|
||||||
|
header(HttpHeaders.AccessControlRequestHeaders)
|
||||||
|
header(HttpHeaders.AccessControlRequestMethod)
|
||||||
|
header("Sec-Fetch-Dest")
|
||||||
|
header("Sec-Fetch-Mode")
|
||||||
|
header("Sec-Fetch-Site")
|
||||||
|
header("sec-ch-ua")
|
||||||
|
header("sec-ch-ua-mobile")
|
||||||
|
header("sec-ch-ua-platform")
|
||||||
|
header(HttpHeaders.UserAgent)
|
||||||
|
header("DNT")
|
||||||
|
allowCredentials = true
|
||||||
|
}
|
||||||
budgetRoutes(budgetRepository, permissionRepository)
|
budgetRoutes(budgetRepository, permissionRepository)
|
||||||
categoryRoutes(categoryRepository, permissionRepository)
|
categoryRoutes(categoryRepository, permissionRepository)
|
||||||
recurringTransactionRoutes(recurringTransactionRepository, permissionRepository)
|
recurringTransactionRoutes(recurringTransactionRepository, permissionRepository)
|
||||||
|
|
Loading…
Reference in a new issue