Skip to content

Commit

Permalink
Use POST query to get version/timezone (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer authored Mar 25, 2024
1 parent f609d8f commit 39fcbc0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ClickHouse.Client/ADO/ClickHouseConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ public override async Task OpenAsync(CancellationToken cancellationToken)
try
{
var uriBuilder = CreateUriBuilder();
uriBuilder.CustomParameters.Add("query", versionQuery);
var request = new HttpRequestMessage(HttpMethod.Get, uriBuilder.ToString());
var request = new HttpRequestMessage(HttpMethod.Post, uriBuilder.ToString())
{
Content = new StringContent(versionQuery, Encoding.UTF8),
};
AddDefaultHttpHeaders(request.Headers);
var response = await HandleError(await HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false), versionQuery, activity).ConfigureAwait(false);
#if NET5_0_OR_GREATER
Expand Down Expand Up @@ -290,7 +292,6 @@ public async Task PostStreamAsync(string sql, Stream data, bool isCompressed, Ca
{
postMessage.Content.Headers.Add("Content-Encoding", "gzip");
}

using var response = await HttpClient.SendAsync(postMessage, HttpCompletionOption.ResponseContentRead, token).ConfigureAwait(false);
await HandleError(response, sql, activity).ConfigureAwait(false);
}
Expand Down

0 comments on commit 39fcbc0

Please sign in to comment.