Skip to content

Commit 436b5fb

Browse files
authored
chore(server): use named arguments for respondText (#1845)
1 parent da495b3 commit 436b5fb

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/ArtifactRoutes.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private fun Route.headArtifact(
6767
val file = call.parameters["file"] ?: return@head call.respondNotFound()
6868

6969
if (file in bindingArtifacts) {
70-
call.respondText("Exists", status = HttpStatusCode.OK)
70+
call.respondText(text = "Exists", status = HttpStatusCode.OK)
7171
} else {
7272
call.respondNotFound()
7373
}
@@ -83,14 +83,14 @@ private fun Route.getArtifact(
8383
get {
8484
val bindingArtifacts = call.toBindingArtifacts(refresh) ?: return@get call.respondNotFound()
8585

86-
if (refresh && !deliverOnRefreshRoute) return@get call.respondText("OK")
86+
if (refresh && !deliverOnRefreshRoute) return@get call.respondText(text = "OK")
8787

8888
val file = call.parameters["file"] ?: return@get call.respondNotFound()
8989

9090
val artifact = bindingArtifacts[file] ?: return@get call.respondNotFound()
9191

9292
when (artifact) {
93-
is TextArtifact -> call.respondText(artifact.data())
93+
is TextArtifact -> call.respondText(text = artifact.data())
9494
is JarArtifact -> call.respondBytes(artifact.data(), ContentType.parse("application/java-archive"))
9595
}
9696

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/InternalRoutes.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import io.micrometer.prometheusmetrics.PrometheusMeterRegistry
77

88
fun Routing.internalRoutes(prometheusRegistry: PrometheusMeterRegistry) {
99
get("/metrics") {
10-
call.respondText(prometheusRegistry.scrape())
10+
call.respondText(text = prometheusRegistry.scrape())
1111
}
1212

1313
get("/status") {
14-
call.respondText("OK")
14+
call.respondText(text = "OK")
1515
}
1616
}

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/Main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ fun main() {
5151

5252
val deliverOnRefreshRoute = System.getenv("GWKT_DELIVER_ON_REFRESH").toBoolean()
5353

54-
suspend fun ApplicationCall.respondNotFound() = respondText("Not found", status = HttpStatusCode.NotFound)
54+
suspend fun ApplicationCall.respondNotFound() = respondText(text = "Not found", status = HttpStatusCode.NotFound)

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/MetadataRoutes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private fun Route.metadata(refresh: Boolean = false) {
2929
val bindingArtifacts = actionCoords.buildPackageArtifacts(githubToken = getGithubToken())
3030
if (file in bindingArtifacts) {
3131
when (val artifact = bindingArtifacts[file]) {
32-
is String -> call.respondText(artifact)
32+
is String -> call.respondText(text = artifact)
3333
else -> call.respondText(text = "Not found", status = HttpStatusCode.NotFound)
3434
}
3535
} else {

0 commit comments

Comments
 (0)