mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix timeouts for HTTP/1.1 non-chunked requests (missing Connection: close)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
38ad4ef493
commit
d940afd6cd
@ -19,6 +19,13 @@ void WriteBufferFromHTTPServerResponse::startSendHeaders()
|
||||
|
||||
if (response.getChunkedTransferEncoding())
|
||||
setChunked();
|
||||
else if (response.getContentLength() == Poco::Net::HTTPMessage::UNKNOWN_CONTENT_LENGTH)
|
||||
{
|
||||
/// In case there is no Content-Length we cannot use keep-alive,
|
||||
/// since there is no way to know when the server send all the
|
||||
/// data, so "Connection: close" should be sent.
|
||||
response.setKeepAlive(false);
|
||||
}
|
||||
|
||||
if (add_cors_header)
|
||||
response.set("Access-Control-Allow-Origin", "*");
|
||||
|
Loading…
Reference in New Issue
Block a user