mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
18 lines
457 B
C++
18 lines
457 B
C++
|
#include <DB/IO/HTTPCommon.h>
|
||
|
|
||
|
#include <Poco/Util/Application.h>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
void setResponseDefaultHeaders(Poco::Net::HTTPServerResponse & response) {
|
||
|
if (!response.getKeepAlive())
|
||
|
return;
|
||
|
|
||
|
Poco::Timespan keep_alive_timeout(Poco::Util::Application::instance().config().getInt("keep_alive_timeout", 10), 0);
|
||
|
if (keep_alive_timeout.totalSeconds())
|
||
|
response.set("Keep-Alive", "timeout=" + std::to_string(keep_alive_timeout.totalSeconds()));
|
||
|
}
|
||
|
|
||
|
}
|