keochris
03/08/2020, 5:23 PMEvan R.
03/09/2020, 4:20 AMHenrik
03/09/2020, 10:23 AMgotoOla
03/09/2020, 2:46 PMbitkid
03/09/2020, 3:06 PMtim
03/10/2020, 10:14 AMget("/path") = authOnly { ... }
? but figured there's a common approach to solving these?Vadim Briliantov
03/10/2020, 6:53 PMhmole
03/11/2020, 1:47 PMLocation
stops workingif I add an optional "packaging" parameter which is supposed to come from query? Uncommenting packaging property makes this location 404, works otherwise.
Is there another hidded knowledge when attempting to work with locations besides incorrect imports?
Ktor version is 1.1.2
@Location(path = "{artifact}/{version}")
data class Request(
val artifact: String,
val version: String/*,
val packaging: String*/
)
fun Application.init() {
routing {
route("myRoute") {
get <Request> { request -> call.respond("") }
head<Request> { request -> call.respond("") }
}
}
}
spierce7
03/11/2020, 7:09 PMJamy
03/12/2020, 4:59 AMcy
03/12/2020, 11:21 AM1.3.2
(with Kotlin 1.3.70 and serialization 0.20.0 has been released
• Introduced iOS streaming response support
• Provided challenge handler in iOS client configuration
• Improved JsonFeature configuration DSL (#1472)
• Simplified server kotlinx.serialization config
• Recovered HttpRequestBuilder.takeFrom
function (#1626)
• Allowed to configure default cookies asynchronously
• Exposed server LocationInfo
and added location resolve functions (#1657)
• Introduced function for async writing to server response channel (#1703)
• Added an option to filter logged calls for ktor-client-logging
• Fixed iOS client timeouts
• Fixed iOS crash
• Fixed 100% CPU Apache Ktor Http Client #1018 (#1689)
• Fixed missing client response logging
• Fixed CIO server local address detection (#1663)
• Fix server request origin to provide header's host and port when available
• Fixed random missing feature errors caused by concurrency at startup (#1694)
• Fixed Set-Cookie
header parser in iOS and JS
• Fixed client multiple redirects with relative path (#1704)
• Fixed unwrapping cancellation exceptions in client (#1482)
• Fixed missed preconfigured OkHttpClient
in OkHttpEngine
(#1646)
• Fixed websocket to complete closeReason on disconnection (#1275).
• Fixed websocket sending CloseReason(1009) when frame is too big
• Fixed websocket pinger logging
• Fixed maxFrameSize for chunked frames
• Fixed URL scheme parser (#1614)
• Fixed platform detection in PlatformUtils.IS_NODE
and PlatformUtils.IS_BROWSER
(#1675)
• Fixed Short.highByte
• Fixed consumeEachBufferRange (#1693)
• Fixed httpclient gzip decoding failure (#1189)
• Fixed InputStream
wrapper for Input
• Bumped versions:
• Kotlin 1.3.70
• kotlinx.coroutines 1.3.4
• kotlinx.serialization 0.20.0
• kotlinx.html 0.7.1
• dropwizard 4.1.2
• slf4j 1.7.30
• mustache 0.9.6
• pebble 3.1.2
• webjars 0.43
• jackson 2.10.2
Known issues:
• Reverted fix for ios memory leak to prevent crashes
❗ No maven central publication due to an unknown verification errorgotoOla
03/12/2020, 1:43 PMgabin
03/12/2020, 2:33 PM03-12 16:17:18.737 4006-4006/com.testapp.android D/NFApi: In validate response method. status: 404 Not Found
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: java.lang.IllegalArgumentException: Bad position (limit 50): 51
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at java.nio.Buffer.positionImpl(Buffer.java:357)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at java.nio.Buffer.position(Buffer.java:351)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.UTFKt.decodeUTF8Line_array(UTF.kt:661)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.UTFKt.decodeUTF8Line(UTF.kt:36)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invokeSuspend(ByteBufferChannel.kt:2120)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.lookAheadSuspend$suspendImpl(ByteBufferChannel.kt:1877)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.lookAheadSuspend(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineToUtf8Suspend(ByteBufferChannel.kt:2116)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineToAscii(ByteBufferChannel.kt:2056)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineTo$suspendImpl(ByteBufferChannel.kt:2144)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineTo(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8Line$suspendImpl(ByteBufferChannel.kt:2148)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8Line(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteReadChannelKt.readUTF8Line(ByteReadChannel.kt:223)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at com.testapp.lib.network.NFApi$client$2$1$4$1.invokeSuspend(NFApi.kt:57)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at com.testapp.lib.network.NFApi$client$2$1$4$1.invoke(NFApi.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.client.features.HttpCallValidator.validateResponse(HttpCallValidator.kt:37)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.client.features.HttpCallValidator$Companion$install$2.invokeSuspend(HttpCallValidator.kt:99)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.client.features.HttpCallValidator$Companion$install$2.invoke(HttpCallValidator.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:318)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:163)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:183)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:75)
Rui
03/12/2020, 2:52 PMrahulrav
03/12/2020, 3:43 PMktor
dispatch requests using a CoroutineContext
?Czar
03/13/2020, 2:08 AMgabin
03/13/2020, 9:55 AMMarc Knaup
03/13/2020, 10:47 AMDslMarker
so that we can mix `Application`/`ApplicationCall`/`Route`/`PipelineInterceptor` etc. receivers with our own server setup DSL 🙂Marc Knaup
03/13/2020, 10:50 AMgabin
03/13/2020, 11:37 AMdambakk
03/13/2020, 5:32 PMAny
serializable object?Marc Knaup
03/14/2020, 10:57 AMintercept(ApplicationCallPipeline.Setup) {
// add attribute
proceed()
// remove attribute
}
Czar
03/14/2020, 2:58 PMwaltermcq
03/15/2020, 1:14 AM{
character but is getting a "
as a result of the call bodyGunslingor
03/15/2020, 2:57 AMfoxx1337
03/15/2020, 3:03 PMstatic
directories? I got
static("ui") {
resources("swagger-ui")
resource("api.json")
defaultResource("swagger-ui/index.html")
}
and when I browse the server at server/path/to/ui
I actually see that index.html
file (direct 200, no reidrects) but I see none of the static resources the index.html
tries to load (it addresses them like ./resource
). Those static resources load just fine if I navigate to server/path/to/ui/
(notice the trailing slash).Gunslingor
03/15/2020, 5:23 PMGunslingor
03/15/2020, 6:48 PMRodrigo Silva
03/15/2020, 8:04 PMnapperley
03/16/2020, 3:50 AM@UnstableDefault
private suspend fun runGenericPromQlQuery(host: String, port: Int, query: String): String =
<http://httpClient.post|httpClient.post>("http://$host:$port") {
contentType(ContentType.parse(FORM_URL_ENCODED))
body = listOf("query" to query).formUrlEncode()
}
napperley
03/16/2020, 3:50 AM@UnstableDefault
private suspend fun runGenericPromQlQuery(host: String, port: Int, query: String): String =
<http://httpClient.post|httpClient.post>("http://$host:$port") {
contentType(ContentType.parse(FORM_URL_ENCODED))
body = listOf("query" to query).formUrlEncode()
}
Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@c15f78
at kfun:kotlin.Throwable.<init>(kotlin.String?)kotlin.Throwable (0x2f7117)
at kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception (0x2f0a25)
at kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException (0x2f05e5)
at kfun:kotlin.native.concurrent.InvalidMutabilityException.<init>(kotlin.String)kotlin.native.concurrent.InvalidMutabilityException (0x31e765)
at ThrowInvalidMutabilityException (0x31fe53)
at MutationCheck (0x63f80e)
at kfun:kotlin.collections.HashMap.<set-length>#internal (0x301ccd)
at kfun:kotlin.collections.HashMap.addKey$stdlib(K)<http://kotlin.Int|kotlin.Int> (0x3062fb)
at kfun:kotlin.collections.HashMap.put(K;V)V? (0x302cd9)
at kfun:io.ktor.util.AttributesNative.put#internal (0x4dfc5f)
at kfun:io.ktor.client.features.$addDefaultResponseValidation$lambda-1$lambda-0COROUTINE$18.invokeSuspend#internal (0x53a41c)
at kfun:io.ktor.client.features.$addDefaultResponseValidation$lambda-1$lambda-0COROUTINE$18.invoke#internal (0x53aad2)
at kfun:io.ktor.client.features.HttpCallValidator.$validateResponseCOROUTINE$24.invokeSuspend#internal (0x54326c)
at kfun:io.ktor.client.features.HttpCallValidator.validateResponse#internal (0x543586)
at kfun:io.ktor.client.features.HttpCallValidator.Companion.$install$lambda-1COROUTINE$23.invokeSuspend#internal (0x5461b0)
at kfun:io.ktor.client.features.HttpCallValidator.Companion.$install$lambda-1COROUTINE$23.invoke#internal (0x546b0f)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc1dd)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal (0x4db85e)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.execute#internal (0x4dbc61)
at kfun:io.ktor.util.pipeline.Pipeline.execute(TContext;TSubject)TSubject (0x4d6a30)
at kfun:io.ktor.client.call.HttpClientCall.$receiveCOROUTINE$13.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? (0x52d097)
at kfun:io.ktor.client.call.HttpClientCall.receive(io.ktor.client.call.TypeInfo)kotlin.Any (0x52d706)
at kfun:com.chapman.batteryMetricsExtractor.$runGenericPromQlQueryCOROUTINE$0.invokeSuspend#internal (0x5f2dc5)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x3125a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith#internal (0x4dc8a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc413)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.object-1.resumeWith#internal (0x4de42c)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x312889)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith#internal (0x4dc8a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc413)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.object-1.resumeWith#internal (0x4de42c)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x312889)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith#internal (0x4dc8a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc413)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.object-1.resumeWith#internal (0x4de42c)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x312889)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith#internal (0x4dc8a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc413)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.object-1.resumeWith#internal (0x4de42c)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x312889)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith#internal (0x4dc8a8)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal (0x4dc413)
at kfun:io.ktor.util.pipeline.SuspendFunctionGun.object-1.resumeWith#internal (0x4de42c)
at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0x312889)
at kfun:kotlinx.coroutines.DispatchedTask.run() (0x3f9aca)
at kfun:kotlinx.coroutines.EventLoopImplBase.processNextEvent()kotlin.Long (0x3d5480)
at kfun:kotlinx.coroutines.BlockingCoroutine.joinBlocking#internal (0x406afe)
at kfun:kotlinx.coroutines.runBlocking(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,T>){0<kotlin.Any?>}Generic (0x405be8)
at kfun:kotlinx.coroutines.runBlocking$default(kotlin.coroutines.CoroutineContext?;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,T>;<http://kotlin.Int|kotlin.Int>){0<kotlin.Any?>}Generic (0x406121)
at kfun:com.chapman.batteryMetricsExtractor.main(kotlin.Array<kotlin.String>) (0x5f0848)
at Konan_start (0x5f771b)
at Init_and_run_start (0x61c08b)
at __libc_start_main (0x7f291a21bb97)
at (0x2ac029)
at ((nil))
e5l
03/16/2020, 2:47 PMbeing serialized
here? We should encode list somehownapperley
03/16/2020, 8:35 PM