diff --git a/server/src/main/kotlin/com/jaytux/phoebench/server/Main.kt b/server/src/main/kotlin/com/jaytux/phoebench/server/Main.kt index 04ea570..352f585 100644 --- a/server/src/main/kotlin/com/jaytux/phoebench/server/Main.kt +++ b/server/src/main/kotlin/com/jaytux/phoebench/server/Main.kt @@ -37,9 +37,6 @@ fun Application.module() { json() } - - install(SSE) {} - val allowLocalhost = environment.config.propertyOrNull("ktor.cors.enableLocalhostOn")?.getString() ?: "0" val safeOrigin = environment.config.propertyOrNull("ktor.cors.browserOrigin")?.getString() install(CORS) { @@ -73,6 +70,8 @@ fun Application.module() { } } + install(SSE) {} + install(StatusPages) { status(HttpStatusCode.Forbidden) { call, status -> call.respond(status, ErrorResponse("Access Forbidden: CORS failed."))