Slackbot
06/29/2019, 3:31 AMgschulze
06/30/2019, 10:36 AMgschulze
06/30/2019, 10:37 AMlenqnr
07/01/2019, 6:01 AM<http://client.post|client.post><String>("/path", "hello")
I get double-quoted data on both sides.
println(call.receiveText())
// Result: "hello"
What is the proper way to handle this?dhristov
07/01/2019, 1:13 PMio.ktor.server.netty.NettyApplicationEngine
. It seems like the inner Configuration's requestQueueLimit
and runningLimit
parameters are not actually used (as far as I can tell by looking in the master branch the idea seems to be that these are propagated to io.ktor.server.netty.cio.NettyRequestQueue
, but don't seem to be used). Are there any plans to actually support these in the future or will they be dropped? If they are planned for support, can I help speed things up (by contributing an implementation for example)? @cyMatej Drobnič
07/01/2019, 5:02 PMqlitzler
07/02/2019, 8:44 AMOperation is a already in progress
exception.
Any advice on what I could do to avoid this in the meantime ?Horv
07/02/2019, 6:15 PMlocation
(in terms of routing) is being deprecated? All oauth examples I can find utilizes that quite heavily and I'm a bit new to Ktor to know my way around things. Anyone can point me to an example of OAuth implementation that doesn't depend on location
and such?Sergioedcigreja
07/03/2019, 10:48 AMpyryjook
07/03/2019, 7:45 PMsuspend fun getContent(): String {
val client = HttpClient()
return client.get<String>("<http://www.google.com>")
}
Any ideas on what might cause it?
I came across with the following similar issues, but I was not able to fix the issue of mine based on how the these issues had been solved:
- https://stackoverflow.com/q/56347516/1538877
- https://github.com/ktorio/ktor/issues/678
All the help is appreciated, thanks in advance!Akram
07/04/2019, 4:01 PMSergio Casero
07/04/2019, 4:01 PMrouting {
authenticate(OauthConfig.NAME) {
route("/test") {
get { call.respond("Sample from auth part...") }
}
}
}
When I call this WS, I set the access token into the auth header (Bearer) with postman but I get 401, if I do the request from browser, I always get a redirection to the login and it generates new token 😞Andrew Gazelka
07/04/2019, 9:48 PMexception.response.content.readUTF8Line()
? For debugging I feel like this overly complicated and confusingSergey Akhapkin
07/05/2019, 2:21 PMdata class Cookie(
val name: String,
val value: String,
val encoding: CookieEncoding = CookieEncoding.URI_ENCODING,
val maxAge: Int = 0,
How it's possible to set cookie without 'maxage' - per standard, it means the lifetime of cookie is restricted by lifetime of client ?zsoltkiss
07/05/2019, 4:47 PMmagoeke
07/05/2019, 9:42 PMdarkmoon_uk
07/07/2019, 9:54 AMtseisel
07/08/2019, 10:16 AMgotoOla
07/08/2019, 3:39 PMLyon Chen
07/09/2019, 4:01 AMAlexander Weickmann
07/09/2019, 11:32 AMJan Stoltman
07/11/2019, 8:23 AMxyz
endpoint and then at almost the same time makes another two to the same endpoint with the same method/payload, I would like to let only the first one to actually reach the server and deliver response to all 3 client requests. Is there any way to achieve this with ktor?sonofblip
07/11/2019, 3:35 PMapplication.routing {
get("myroute") {
val queryParams = call.parameters // the query params from the call
val paramsMap: Map<String, String> = queryParams.toMap().mapValues { it.value.first() } // I can put them in a map of string fairly easily
val instanceOfMyClass: MyClass = MyClass(paramsMap["val1"], paramsMap["val2"], etc...) // I have to map them to my class manually each time :(
// do stuff with the query params
call.respondJson("your response here.")
}
}
To be clear, the equivalent of what I’m looking for in spring would look like:
import javax.validation.Valid;
@RequestMapping(value = "/getItem", method = RequestMethod.GET)
public ServiceRequest<List<SomeModel>> getClaimStatuses(@Valid RequestParamsModel model) {
// ...
}
and in JAX-RS it’d use @BeanParam
https://dennis-xlc.gitbooks.io/restful-java-with-jax-rs-2-0-2rd-edition/en/part1/chapter5/bean_param.htmlmbonnin
07/13/2019, 12:03 PMdetouched
07/15/2019, 2:10 AMApplicationReceivePipeline.Before
– this kinda works, but in case of invalid signature after I send 401 back and call finish()
I still get CannotTransformContentToTypeException
in the related target route. I understand that it's what triggers receive pipeline, so this setup is obviously wrong. Seeking for the right solution, appreciate any help.coderskitchen
07/15/2019, 7:32 PMAntanas A.
07/17/2019, 2:58 PMjava.io.IOException: Software caused connection abort
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:382)
at kotlinx.io.nio.ChannelsKt.read(Channels.kt:117)
at io.ktor.network.sockets.CIOReaderKt$attachForReadingDirectImpl$1$1.invokeSuspend(CIOReader.kt:75)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.ResumeModeKt.resumeMode(ResumeMode.kt:67)
at kotlinx.coroutines.DispatchedKt.resume(Dispatched.kt:309)
at kotlinx.coroutines.DispatchedKt.resumeUnconfined(Dispatched.kt:49)
at kotlinx.coroutines.DispatchedKt.dispatch(Dispatched.kt:295)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:250)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:260)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:189)
at io.ktor.network.selector.SelectorManagerSupport.handleSelectedKey(SelectorManagerSupport.kt:83)
at io.ktor.network.selector.SelectorManagerSupport.handleSelectedKeys(SelectorManagerSupport.kt:63)
at io.ktor.network.selector.ActorSelectorManager.process(ActorSelectorManager.kt:74)
at io.ktor.network.selector.ActorSelectorManager$process$1.invokeSuspend(ActorSelectorManager.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
I've added everythere try catch blocks but still this exception was not caught anywhere. Maybe anyone can help me how to overcome this?pardom
07/17/2019, 3:52 PMwebsocket
routes and http
routes? I get a 500
hitting an http
route when a websocket route is open. I thought it would suspend.Ovsyannikov Alexey
07/18/2019, 10:57 AMktor client
and ktor cio
quiqua
07/18/2019, 2:05 PMHttpClient
provided by ktor - can it be used as a singleton or should new requests made with different instances ?quiqua
07/18/2019, 2:05 PMHttpClient
provided by ktor - can it be used as a singleton or should new requests made with different instances ?kodein
configuration to use a singleton bind<HttpClient>() with singleton { HttpClient(OkHttp) }
, but are also confronted with a memory leak in our app and I currently suspect the HttpClient 🤔e5l
07/18/2019, 2:11 PMquiqua
07/18/2019, 2:13 PMHttpResponse.close
method called automatically or is it my responsibility to do so at some part of the code execution?e5l
07/18/2019, 2:28 PMclose
manually or with response.use { }
methodquiqua
07/18/2019, 2:30 PM