-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
inline Client::Client(const std::string &scheme_host_port,
const std::string &client_cert_path,
const std::string &client_key_path) {
.......
auto host = m[2].str();
if (host.empty()) { host = m[3].str(); }
.......
If the client initiates an IPv6 request, the IPv6 address in the host field of the request header is not used [], which can cause the server to receive an error in parsing the request header.
Add the following code to fix this bug
inline Client::Client(const std::string &scheme_host_port,
const std::string &client_cert_path,
const std::string &client_key_path) {
.......
auto host = m[2].str();
if (host.empty()) { host = m[3].str(); }
if (host.find(':') != std::string::npos) { host = "[" + host + "]"; } // this code
.......
Hope it's useful