| 569 | } |
| 570 | |
| 571 | void THttpServer::returnUnauthorized() { |
| 572 | std::ostringstream h; |
| 573 | h << "HTTP/1.1 401 Unauthorized" << CRLF << "Date: " << getTimeRFC1123() << CRLF |
| 574 | << "Connection: close" << CRLF; |
| 575 | vector<string> return_headers = callbacks_.return_headers_fn(); |
| 576 | for (const string& header : return_headers) { |
| 577 | h << header << CRLF; |
| 578 | } |
| 579 | h << CRLF; |
| 580 | string header = h.str(); |
| 581 | transport_->write((const uint8_t*)header.c_str(), static_cast<uint32_t>(header.size())); |
| 582 | transport_->flush(); |
| 583 | } |
| 584 | |
| 585 | void THttpServer::returnWrappedResponse(const impala::TWrappedHttpResponse& response) { |
| 586 | int code = response.status_code; |