fix: Configure CORS correctly

This commit is contained in:
oSumAtrIX
2024-07-11 03:50:48 +02:00
parent a7666ba29d
commit 2ed4cf3b40
3 changed files with 14 additions and 21 deletions

View File

@@ -13,10 +13,12 @@ fun Application.configureHTTP() {
val configurationRepository = get<ConfigurationRepository>()
install(CORS) {
allowHost(
host = configurationRepository.cors.host,
subDomains = configurationRepository.cors.subDomains,
)
configurationRepository.corsAllowedHosts.forEach { host ->
allowHost(
host = host,
schemes = listOf("http", "https")
)
}
}
install(RateLimit) {