2018-08-08 16:15:29 +00:00
|
|
|
#include "HandlerFactory.h"
|
|
|
|
#include <Common/HTMLForm.h>
|
|
|
|
|
|
|
|
#include <Poco/Ext/SessionPoolHelpers.h>
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
|
|
#include <common/logger_useful.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
Poco::Net::HTTPRequestHandler * HandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest & request)
|
|
|
|
{
|
|
|
|
const auto & uri = request.getURI();
|
|
|
|
LOG_TRACE(log, "Request URI: " + uri);
|
|
|
|
|
|
|
|
if (uri == "/ping" && request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET)
|
|
|
|
return new PingHandler(keep_alive_timeout);
|
|
|
|
|
|
|
|
if (request.getMethod() == Poco::Net::HTTPRequest::HTTP_POST)
|
2018-08-09 12:57:34 +00:00
|
|
|
return new ODBCHandler(pool_map, keep_alive_timeout, context);
|
2018-08-08 16:15:29 +00:00
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|