Dani Morillas
10/04/2022, 2:58 PMJoão Gabriel Zó
10/04/2022, 6:25 PMBadRequestException
from Ktor just gives me “Illegal Input” and doesn’t actually say whats wrong with the request. Is there a way to improve it?Alexander Weickmann
10/04/2022, 8:42 PMsuresh
10/05/2022, 12:46 AMFatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.ktor.client.engine.cio.CIOEngine.<init>(io.ktor.client.engine.cio.CIOEngineConfig)
Parsing context:
at io.ktor.client.engine.cio.CIOEngine.<init>(CIOEngine.kt)
at io.ktor.client.engine.cio.CIO.create(CIOCommon.kt:35)
at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:41)
zt
10/05/2022, 1:43 AMbenkuly
10/05/2022, 12:48 PMMatthew Murray
10/05/2022, 9:06 PMThomas
10/06/2022, 11:16 AMPHondogo
10/06/2022, 2:41 PMspierce7
10/06/2022, 7:03 PMTrey
10/06/2022, 7:49 PMspierce7
10/06/2022, 10:31 PMJustin (Midas) Gilman
10/07/2022, 7:58 PMAuthorization
header isn't a valid JWT token (misconfigured environment might pass null
or empty string) I want to log an error on the server "Missing or Invalid JWT Token". Is there a place I can do this?Gaurav Tyagi
10/08/2022, 9:04 AMdongock.kim
10/10/2022, 6:59 AMServerSocket
and a Socket
accepted to this server socket with keepAlive = true
option.
If the client device connected to this Socket
lost internet connection, this Socket
can’t know this socket is broken.
Even though I have a keepAlive
option, can somebody helps me what’s the problem?
Sever
val serverSocket = aSocket(SelectorManager(<http://Dispatchers.IO|Dispatchers.IO>)).tcp().bind(host, port)
val socket = serverSocket.accept()
Client
val socket = aSocket(ActorSelectorManager(<http://Dispatchers.IO|Dispatchers.IO>).tcp().connect(host, port) { keepAlive = true }
PHondogo
10/10/2022, 10:07 AMEivind
10/10/2022, 10:32 AMaHttpClient.plugin(HttpSend).intercept { request -> .... }
val newHttpClinet = aHttpClient.config { .... }
Julius
10/12/2022, 12:36 PMval uploadHttpClient = HttpClient()
val uploadResponse = uploadHttpClient.put(cloudflarePresignedPutUrl) {
setBody(mediaFile)
}
Sadly there's a bug in cloudflare's r2 that makes cors break when you set any headerPavel Kunyavskiy [JB]
10/12/2022, 8:42 PMSystem.exit()
, but that's looks too rude way to stop. Maybe you have some better way to do that?João Gabriel Zó
10/13/2022, 12:28 PMPoisonedYouth
10/13/2022, 5:57 PMcall.respondOutputStream {
fileHandler.download(this)
}
I could only find following question on stackoverflow: https://stackoverflow.com/questions/69408466/how-to-propagate-error-in-outputstream-to-client-when-using-ktorzt
10/14/2022, 6:26 AMsimon.vergauwen
10/14/2022, 10:36 AMmacArm64
(have not tried linux yet), but when I call engine.stop(5000, 10_000)
on the ApplicationEngine
it keeps the port occupied, and I get following exception when I try to re-run the server. I'm running the hello world example from the samples repo. Any ideas on how to fix this? Or is this a bug? I couldn't find any bug report on YouTrack, but happy to add one if needed ☺️
Uncaught Kotlin exception: io.ktor.utils.io.errors.PosixException.AddressAlreadyInUseException: EADDRINUSE (48): Address already in use
benkuly
10/14/2022, 3:05 PMIvan Kupriyanov
10/14/2022, 6:16 PMktor.client
from 1.6.8
to 2.1.1
- nothing happens when I try to open a websocket. There are no errors, no logs with engine { this@HttpClient.developmentMode = true }
, even no connection in devTools/Network tab. Same issue in Chrome and Firefox. It's hard to provide minimal reproducible example as I'm talking about interactive maps, and this issue (causes tiles to not load) happens only in https://datalore.jetbrains.com/ and works well in kaggle, colab, jupyter, deepnote, nextjournal.
The last line to be executed is:
https://github.com/JetBrains/lets-plot/blob/master/gis/src/commonMain/kotlin/jetbrains/gis/tileprotocol/socket/TileWebSocket.kt#L24
Code inside this receiver never runs in datalore.
I understand that it is very difficult to diagnose a problem without an example, but even a tiny tip what have been changed in 2.0.0
and what can cause such behaviour can help.
Thanks in advance.
Issue: https://youtrack.jetbrains.com/issue/KTOR-4993coroutinedispatcher
10/16/2022, 8:00 AMTomislav Hofman
10/16/2022, 3:39 PMKristian Nedrevold
10/16/2022, 6:54 PMLukas S
10/16/2022, 7:08 PMrouting {
authenticate(UserAuthentication.USER_SESSION) {
authenticate(OAUTH_NAME) {
ebayLogin()
}
}
}
authentication {
oauth(OAUTH_NAME) {
urlProvider = { System.getenv("EBAY_REDIRECT_URI") }
providerLookup = {
OAuthServerSettings.OAuth2ServerSettings(
name = "eBay",
authorizeUrl = "<https://auth.ebay.com/oauth2/authorize>",
accessTokenUrl = "<https://api.ebay.com/identity/v1/oauth2/token>",
requestMethod = <http://HttpMethod.Post|HttpMethod.Post>,
clientId = System.getenv("EBAY_CLIENT_ID"),
clientSecret = System.getenv("EBAY_CLIENT_SECRET"),
defaultScopes = listOf(
"<https://api.ebay.com/oauth/api_scope>",
),
accessTokenRequiresBasicAuth = true,
extraTokenParameters = listOf()
)
}
client = HttpClient(CIO) {
install(ContentNegotiation) {
json()
}
}
}
}
fun Route.ebayLogin() {
get("/ebay/login") {
// redirects to 'authorizeUrl' automatically
}
get("/ebay/login/callback") {
val principal = call.principal<OAuthAccessTokenResponse.OAuth2>()
// TODO: save token to database
call.respondRedirect("/ebay")
}
}
Thanks!benkuly
10/17/2022, 6:33 AMcreateRouteScopedPlugin
?benkuly
10/17/2022, 6:33 AMcreateRouteScopedPlugin
?Aleksei Tirman [JB]
10/17/2022, 1:12 PMbenkuly
10/17/2022, 1:18 PM