src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt

changeset 409
109850e92e95
parent 407
fa8274466c70
--- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Tue Jan 06 19:14:24 2026 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Tue Jan 06 20:08:54 2026 +0100
@@ -221,6 +221,11 @@
         response.writer.write(json)
     }
 
+    fun renderText(text: String, type: String = "plain") {
+        response.contentType = "text/${type}; charset=utf-8"
+        response.writer.write(text)
+    }
+
     fun render(page: String? = null) {
         page?.let { contentPage = it }
         forward("site")

mercurial