Skip to content

Commit

Permalink
Fix response headers not being set by ktor (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiKoS0 authored Sep 8, 2024
1 parent 0c1f598 commit 227393c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions inngest/src/main/kotlin/com/inngest/ktor/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,15 @@ fun Route.serve(
val body = call.receiveText()
try {
val response = comm.callFunction(fnId, body)
call.response.header(
HttpHeaders.ContentType,
ContentType.Application.Json.toString(),
)
response.headers.forEach({ (k, v) -> call.response.header(k, v) })
call.response.status(
HttpStatusCode(response.statusCode.code, response.statusCode.message),
)
// println("response: " + response.body)
call.respond(response.body)
call.respondText(response.body)
} catch (e: Exception) {
call.respond(HttpStatusCode.InternalServerError, e.toString())
}
}

call.respondText("Invoke functions")
}

put("") {
Expand Down

0 comments on commit 227393c

Please sign in to comment.