Skip to content

Commit

Permalink
Fix always truthy condition
Browse files Browse the repository at this point in the history
  • Loading branch information
KiKoS0 committed Sep 12, 2024
1 parent 71b56ad commit 06135c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inngest/src/main/kotlin/com/inngest/ktor/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ fun Route.serve(
}
}

val HTTP_PORTS = listOf(80, 443)

fun getOrigin(call: ApplicationCall): String {
var origin = String.format("%s://%s", call.request.origin.scheme, call.request.origin.serverHost)
if (call.request.origin.serverPort != 80 || call.request.origin.serverPort != 443) {
if (call.request.origin.serverPort !in HTTP_PORTS) {
origin = String.format("%s:%s", origin, call.request.origin.serverPort)
}
return origin
Expand Down

0 comments on commit 06135c3

Please sign in to comment.