nghttpx: Omit well-known port from hostport in downstream request
This commit is contained in:
parent
de0543f684
commit
7b90404072
|
@ -506,6 +506,10 @@ int Http2Session::downstream_connect_proxy() {
|
|||
|
||||
std::string req = "CONNECT ";
|
||||
req += downstream_addr.hostport.get();
|
||||
if (downstream_addr.port == 80 || downstream_addr.port == 443) {
|
||||
req += ":";
|
||||
req += util::utos(downstream_addr.port);
|
||||
}
|
||||
req += " HTTP/1.1\r\nHost: ";
|
||||
req += downstream_addr.host.get();
|
||||
req += "\r\n";
|
||||
|
|
|
@ -1038,8 +1038,10 @@ std::string make_hostport(const char *host, uint16_t port) {
|
|||
hostport += "]";
|
||||
}
|
||||
|
||||
if (port != 80 && port != 443) {
|
||||
hostport += ":";
|
||||
hostport += utos(port);
|
||||
}
|
||||
|
||||
return hostport;
|
||||
}
|
||||
|
|
|
@ -609,7 +609,7 @@ std::string format_duration(const std::chrono::microseconds &u);
|
|||
|
||||
// Creates "host:port" string using given |host| and |port|. If
|
||||
// |host| is numeric IPv6 address (e.g., ::1), it is enclosed by "["
|
||||
// and "]".
|
||||
// and "]". If |port| is 80 or 443, port part is omitted.
|
||||
std::string make_hostport(const char *host, uint16_t port);
|
||||
|
||||
} // namespace util
|
||||
|
|
Loading…
Reference in New Issue