mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Buildable code
This commit is contained in:
parent
1c8e33414f
commit
d913f327ed
@ -104,7 +104,7 @@ void InterserverIOHTTPHandler::handleRequest(HTTPServerRequest & request, HTTPSe
|
||||
|
||||
try
|
||||
{
|
||||
if (checkAuthentication(request))
|
||||
if (auto [message, success] = checkAuthentication(request); success)
|
||||
{
|
||||
processQuery(request, response, used_output);
|
||||
used_output.out->finalize();
|
||||
@ -121,7 +121,7 @@ void InterserverIOHTTPHandler::handleRequest(HTTPServerRequest & request, HTTPSe
|
||||
{
|
||||
if (e.code() == ErrorCodes::WRONG_PASSWORD)
|
||||
{
|
||||
response.setStatusAndReason(Poco::Net::HTTPServerResponse::HTTP_UNAUTHORIZED);
|
||||
response.setStatusAndReason(HTTPServerResponse::HTTP_UNAUTHORIZED);
|
||||
if (!response.sent())
|
||||
writeString("Unauthorized.", *used_output.out);
|
||||
LOG_WARNING(log, "Query processing failed request: '{}' authentication failed", request.getURI());
|
||||
|
@ -47,10 +47,9 @@ private:
|
||||
|
||||
void processQuery(HTTPServerRequest & request, HTTPServerResponse & response, Output & used_output);
|
||||
|
||||
bool checkAuthentication(Poco::Net::HTTPServerRequest & request) const;
|
||||
std::pair<String, bool> checkAuthentication(HTTPServerRequest & request) const;
|
||||
const std::string default_user;
|
||||
const std::string default_password;
|
||||
std::pair<String, bool> checkAuthentication(HTTPServerRequest & request) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user