Skip to content

Commit 6442757

Browse files
committed
fix: Configure CORS properly to allow authorization and content-type header
1 parent 710416f commit 6442757

File tree

1 file changed

+6
-0
lines changed
  • src/main/kotlin/app/revanced/api/configuration

1 file changed

+6
-0
lines changed

src/main/kotlin/app/revanced/api/configuration/HTTP.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package app.revanced.api.configuration
22

33
import app.revanced.api.configuration.repository.ConfigurationRepository
4+
import io.ktor.http.*
45
import io.ktor.server.application.*
56
import io.ktor.server.plugins.*
67
import io.ktor.server.plugins.cors.routing.*
@@ -13,6 +14,11 @@ fun Application.configureHTTP() {
1314
val configurationRepository = get<ConfigurationRepository>()
1415

1516
install(CORS) {
17+
allowHeader(HttpHeaders.ContentType)
18+
allowHeader(HttpHeaders.Authorization)
19+
20+
allowCredentials = true
21+
1622
configurationRepository.corsAllowedHosts.forEach { host ->
1723
allowHost(
1824
host = host,

0 commit comments

Comments
 (0)