mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
495c6e03aa
* Replace all Context references with std::weak_ptr * Fix shared context captured by value * Fix build * Fix Context with named sessions * Fix copy context * Fix gcc build * Merge with master and fix build * Fix gcc-9 build
24 lines
729 B
C++
24 lines
729 B
C++
#include "HandlerFactory.h"
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
#include <Server/HTTP/HTMLForm.h>
|
|
#include "Handlers.h"
|
|
|
|
|
|
namespace DB
|
|
{
|
|
std::unique_ptr<HTTPRequestHandler> LibraryBridgeHandlerFactory::createRequestHandler(const HTTPServerRequest & request)
|
|
{
|
|
Poco::URI uri{request.getURI()};
|
|
LOG_DEBUG(log, "Request URI: {}", uri.toString());
|
|
|
|
if (uri == "/ping" && request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET)
|
|
return std::make_unique<PingHandler>(keep_alive_timeout);
|
|
|
|
if (request.getMethod() == Poco::Net::HTTPRequest::HTTP_POST)
|
|
return std::make_unique<LibraryRequestHandler>(keep_alive_timeout, getContext());
|
|
|
|
return nullptr;
|
|
}
|
|
}
|