Skip to content

Commit b3361b4

Browse files
committed
fix: allow https scheme in CORS allowHost entries
Ktor's allowHost() defaults schemes to ["http"], so requests from real browsers sending Origin: https://feedback.java.no were being rejected by the CORS plugin before reaching the route handler, even though the host itself was allowlisted. Explicitly allow https for all configured hosts.
1 parent 373d004 commit b3361b4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • core/src/main/kotlin/no/javazone/feedback

‎core/src/main/kotlin/no/javazone/feedback/App.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ fun Application.module(
3838
json()
3939
}
4040
install(CORS) {
41-
allowHost("javazone.no", subDomains = listOf("screens"))
42-
allowHost("feedback.java.no")
43-
allowHost("f.java.no")
41+
allowHost("javazone.no", subDomains = listOf("screens"), schemes = listOf("https"))
42+
allowHost("feedback.java.no", schemes = listOf("https"))
43+
allowHost("f.java.no", schemes = listOf("https"))
4444
}
4545
install(CallLogging)
4646
install(Authentication) {

0 commit comments

Comments
 (0)