Browse Source

upgrade http4k and fix to plaintext (#3049)

* upgrade http4k and fix to plaintext

* tweak fix to plaintext to make it in line with #3048
David Denton 7 years ago
parent
commit
5e3fa39e57

+ 1 - 1
frameworks/Kotlin/http4k/build.gradle

@@ -1,6 +1,6 @@
 buildscript {
     ext.kotlin_version = "1.1.50"
-    ext.http4k_version = "2.31.3"
+    ext.http4k_version = "2.37.0"
 
     repositories {
         mavenCentral()

+ 4 - 4
frameworks/Kotlin/http4k/core/src/main/kotlin/Http4kBenchmarkServer.kt

@@ -12,10 +12,10 @@ object Http4kBenchmarkServer {
     private val headers = Filter { next ->
         {
             next(it).let {
-                it
-                    .header("Server", "http4k")
-                    .header("Date", dateFormat.format(System.currentTimeMillis()))
-                    .header("Content-Length", it.body.payload.remaining().toString())
+                it.headers(listOf(
+                    "Server" to "http4k",
+                    "Date" to dateFormat.format(System.currentTimeMillis()),
+                    "Content-Length" to it.body.length.toString()))
             }
         }
     }