From bc2b26292da7234151bb989ce271a4b6bcbb62f3 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 28 Dec 2019 18:00:50 +0800 Subject: [PATCH] Fix missing port in origin for redirect --- src/net/tools/naive/naive_connection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tools/naive/naive_connection.cc b/src/net/tools/naive/naive_connection.cc index cae3b73692..339990beb0 100644 --- a/src/net/tools/naive/naive_connection.cc +++ b/src/net/tools/naive/naive_connection.cc @@ -214,7 +214,7 @@ int NaiveConnection::DoConnectServer() { const auto& addr = ipe.address(); auto name = resolver_->FindNameByAddress(addr); if (!name.empty()) { - origin.set_host(name); + origin = HostPortPair(name, ipe.port()); } else if (!resolver_->IsInResolvedRange(addr)) { origin = HostPortPair::FromIPEndPoint(ipe); } else {