add back response check

This commit is contained in:
Arthur Passos 2024-05-23 14:57:19 +00:00
parent 5f2cd1740b
commit 5f3778fc1a

View File

@ -22,6 +22,9 @@ std::string RemoteProxyHostFetcherImpl::fetch(const Poco::URI & endpoint, const
Poco::Net::HTTPResponse response;
auto & response_body_stream = session->receiveResponse(response);
if (response.getStatus() != Poco::Net::HTTPResponse::HTTP_OK)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Proxy resolver returned not OK status: {}", response.getReason());
std::string proxy_host;
Poco::StreamCopier::copyToString(response_body_stream, proxy_host);