tomasfabian / ksqlDB.RestApi.Client-DotNet

ksqlDb.RestApi.Client is a C# LINQ-enabled client API for issuing and consuming ksqlDB push and pull queries and executing statements.
MIT License
97 stars 26 forks source link

Requests with KSqlDbRestApiClient can result in 431 error codes #80

Closed jbkuczma closed 6 months ago

jbkuczma commented 6 months ago

I have a BackgroundService that is responsible for opening a push query and making sure it stays alive. I do this by executing SHOW QUERIES; to the /ksql endpoint and verify that the query is still running. I have noticed since this runs on a loop that after awhile I will begin to receive 431 error codes indicating that the header is too large on my request. I believe the issue is here and is due to the value being appended to the existing header since there is already a value present.

An example output to my console when I turn on trace logging

info: System.Net.Http.HttpClient.IHttpClientFactory.ClientHandler[100]
      Sending HTTP request POST /ksql

trce: System.Net.Http.HttpClient.IHttpClientFactory.ClientHandler[102]
      Request Headers:
      Accept: application/vnd.ksql.v1+json, application/vnd.ksql.v1+json, application/vnd.ksql.v1+json
      Authorization: basic [redacted]
      Content-Type: application/vnd.ksql.v1+json; charset=utf-8
tomasfabian commented 6 months ago

Hello @jbkuczma, I released the v6.0.1 patch.

jbkuczma commented 6 months ago

Working for me, thank you!