2020-07-06 12:23:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
#include <Server/HTTP/HTTPRequestHandler.h>
|
|
|
|
|
2020-07-06 12:23:36 +00:00
|
|
|
#include <Poco/Logger.h>
|
|
|
|
|
|
|
|
#if USE_ODBC
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
class Context;
|
2020-07-06 12:23:36 +00:00
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
/// This handler establishes connection to database, and retrieves whether schema is allowed.
|
|
|
|
class SchemaAllowedHandler : public HTTPRequestHandler
|
2020-07-06 12:23:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SchemaAllowedHandler(size_t keep_alive_timeout_, Context &)
|
|
|
|
: log(&Poco::Logger::get("SchemaAllowedHandler")), keep_alive_timeout(keep_alive_timeout_)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) override;
|
2020-07-06 12:23:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Poco::Logger * log;
|
|
|
|
size_t keep_alive_timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|