mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 18:32:29 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
34 lines
765 B
C++
34 lines
765 B
C++
#include "RootRequestHandler.h"
|
|
|
|
#include <IO/HTTPCommon.h>
|
|
|
|
#include <Common/Exception.h>
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
#include <Poco/Net/HTTPServerResponse.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void RootRequestHandler::handleRequest(
|
|
Poco::Net::HTTPServerRequest &,
|
|
Poco::Net::HTTPServerResponse & response)
|
|
{
|
|
try
|
|
{
|
|
const auto & config = server.config();
|
|
setResponseDefaultHeaders(response, config.getUInt("keep_alive_timeout", 10));
|
|
|
|
response.setContentType("text/html; charset=UTF-8");
|
|
|
|
const std::string data = config.getString("http_server_default_response", "Ok.\n");
|
|
response.sendBuffer(data.data(), data.size());
|
|
}
|
|
catch (...)
|
|
{
|
|
tryLogCurrentException("RootRequestHandler");
|
|
}
|
|
}
|
|
|
|
}
|