Skip to content

Commit

Permalink
Allow credentials CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
naviktthomas committed Sep 18, 2024
1 parent 5d3c4b6 commit f1df7f6
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package no.nav.paw.bekreftelse.api.plugins

import io.ktor.http.HttpHeaders
import io.ktor.http.HttpMethod
import io.ktor.server.application.Application
import io.ktor.server.application.ApplicationCall
import io.ktor.server.application.install
Expand Down Expand Up @@ -33,14 +35,16 @@ fun Application.configureHTTP(applicationConfig: ApplicationConfig) {
NaisEnv.Local -> anyHost()
}

allowMethod(io.ktor.http.HttpMethod.Options)
allowMethod(io.ktor.http.HttpMethod.Head)
allowMethod(io.ktor.http.HttpMethod.Get)
allowMethod(io.ktor.http.HttpMethod.Post)
allowMethod(HttpMethod.Options)
allowMethod(HttpMethod.Head)
allowMethod(HttpMethod.Get)
allowMethod(HttpMethod.Post)

allowHeader(io.ktor.http.HttpHeaders.Authorization)
allowHeader(io.ktor.http.HttpHeaders.ContentType)
allowHeader(io.ktor.http.HttpHeaders.AccessControlAllowOrigin)
allowHeader(HttpHeaders.Authorization)
allowHeader(HttpHeaders.ContentType)
allowHeader(HttpHeaders.AccessControlAllowOrigin)

allowCredentials = true

allowHeadersPrefixed("nav-")
}
Expand Down

0 comments on commit f1df7f6

Please sign in to comment.