diff --git a/presto-native-execution/presto_cpp/main/PrestoExchangeSource.cpp b/presto-native-execution/presto_cpp/main/PrestoExchangeSource.cpp index fc246db319c9c..936c900001c6d 100644 --- a/presto-native-execution/presto_cpp/main/PrestoExchangeSource.cpp +++ b/presto-native-execution/presto_cpp/main/PrestoExchangeSource.cpp @@ -197,6 +197,7 @@ void PrestoExchangeSource::doRequest( protocol::PRESTO_MAX_WAIT_HTTP_HEADER, protocol::Duration(maxWait.count(), protocol::TimeUnit::MICROSECONDS) .toString()) + .header(proxygen::HTTP_HEADER_HOST, fmt::format("{}:{}", host_, port_)) .send(httpClient_.get(), "", delayMs) .via(driverExecutor_) .thenTry( diff --git a/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp b/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp index 321332ff3c386..2018bfaf97213 100644 --- a/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp +++ b/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp @@ -129,9 +129,11 @@ class Producer { } proxygen::RequestHandler* getResults( - proxygen::HTTPMessage* /*message*/, + proxygen::HTTPMessage* message, const std::vector& pathMatch, bool getDataSizeOnly) { + const auto& headers = message->getHeaders(); + VELOX_CHECK(headers.exists(proxygen::HTTP_HEADER_HOST)); protocol::TaskId taskId = pathMatch[1]; long sequence = std::stol(pathMatch[3]);