Skip to content

Commit 8fa7a17

Browse files
majetideepakyabinma
authored andcommitted
[native] Add header proxygen::HTTP_HEADER_HOST to PrestoExchangeSource
Co-authored-by: Yabin Ma <[email protected]>
1 parent 3fd0609 commit 8fa7a17

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

presto-native-execution/presto_cpp/main/PrestoExchangeSource.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void PrestoExchangeSource::doRequest(
197197
protocol::PRESTO_MAX_WAIT_HTTP_HEADER,
198198
protocol::Duration(maxWait.count(), protocol::TimeUnit::MICROSECONDS)
199199
.toString())
200+
.header(proxygen::HTTP_HEADER_HOST, fmt::format("{}:{}", host_, port_))
200201
.send(httpClient_.get(), "", delayMs)
201202
.via(driverExecutor_)
202203
.thenTry(

presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ class Producer {
129129
}
130130

131131
proxygen::RequestHandler* getResults(
132-
proxygen::HTTPMessage* /*message*/,
132+
proxygen::HTTPMessage* message,
133133
const std::vector<std::string>& pathMatch,
134134
bool getDataSizeOnly) {
135+
const auto& headers = message->getHeaders();
136+
VELOX_CHECK(headers.exists(proxygen::HTTP_HEADER_HOST));
135137
protocol::TaskId taskId = pathMatch[1];
136138
long sequence = std::stol(pathMatch[3]);
137139

0 commit comments

Comments
 (0)