mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
414f470c79
* Refactoring: part 1 * Refactoring: part 2 * Handle request using ReadBuffer interface * Struggles with ReadBuffer's * Fix URI parsing * Implement parsing of multipart/form-data * Check HTTP_LENGTH_REQUIRED before eof() or will hang * Fix HTTPChunkedReadBuffer * Fix build and style * Fix test * Resist double-eof * Fix arcadian build
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
#include <Server/NotFoundHandler.h>
|
|
|
|
#include <IO/HTTPCommon.h>
|
|
#include <Common/Exception.h>
|
|
|
|
namespace DB
|
|
{
|
|
void NotFoundHandler::handleRequest(HTTPServerRequest & request, HTTPServerResponse & response)
|
|
{
|
|
try
|
|
{
|
|
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_FOUND);
|
|
*response.send() << "There is no handle " << request.getURI() << "\n\n"
|
|
<< "Use / or /ping for health checks.\n"
|
|
<< "Or /replicas_status for more sophisticated health checks.\n\n"
|
|
<< "Send queries from your program with POST method or GET /?query=...\n\n"
|
|
<< "Use clickhouse-client:\n\n"
|
|
<< "For interactive data analysis:\n"
|
|
<< " clickhouse-client\n\n"
|
|
<< "For batch query processing:\n"
|
|
<< " clickhouse-client --query='SELECT 1' > result\n"
|
|
<< " clickhouse-client < query > result\n";
|
|
}
|
|
catch (...)
|
|
{
|
|
tryLogCurrentException("NotFoundHandler");
|
|
}
|
|
}
|
|
|
|
}
|