From 17d681bd42b0a9a90aa746085613cef70b85b55f Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 6 Dec 2022 22:51:09 +0300 Subject: [PATCH] Add response type --- .../src/jvmMain/kotlin/ru/inr/mass/data/server/server.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/numass-data-server/src/jvmMain/kotlin/ru/inr/mass/data/server/server.kt b/numass-data-server/src/jvmMain/kotlin/ru/inr/mass/data/server/server.kt index eb2aad0..a4925d3 100644 --- a/numass-data-server/src/jvmMain/kotlin/ru/inr/mass/data/server/server.kt +++ b/numass-data-server/src/jvmMain/kotlin/ru/inr/mass/data/server/server.kt @@ -1,5 +1,6 @@ package ru.inr.mass.data.server +import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode import io.ktor.server.application.Application import io.ktor.server.application.call @@ -86,7 +87,7 @@ public fun Application.numassModule() { } get("/repository") { - call.respondText { + call.respondText(ContentType.Application.Json) { visionManager.encodeToString(VisionOfNumassRepository(Name.EMPTY, repository)) } } @@ -106,7 +107,7 @@ public fun Application.numassModule() { return@get } - call.respondText { + call.respondText(ContentType.Application.Json) { visionManager.encodeToString(VisionOfNumassSet(setName, set)) } } @@ -135,7 +136,7 @@ public fun Application.numassModule() { call.respondText(status = HttpStatusCode.NotFound) { "A point with name $setName/$pointIndex not found in the repository" } return@get } - call.respondText { + call.respondText(ContentType.Application.Json) { visionManager.encodeToString(point.toVision()) } }