mirror of https://github.com/aria2/aria2
HttpProxyOptionHandler: Enclose hostname with square brackets if
hostname is IPv6 numeric address.pull/2/head
parent
2d6e087f58
commit
065fb3a6b8
|
@ -697,7 +697,12 @@ void HttpProxyOptionHandler::parseArg(Option& option, const std::string& optarg)
|
|||
if(uri.size() > 7) {
|
||||
uri += "@";
|
||||
}
|
||||
strappend(uri, req.getHost(), A2STR::COLON_C, util::uitos(req.getPort()));
|
||||
if(req.isIPv6LiteralAddress()) {
|
||||
strappend(uri, "[", req.getHost(), "]");
|
||||
} else {
|
||||
uri += req.getHost();
|
||||
}
|
||||
strappend(uri, A2STR::COLON_C, util::uitos(req.getPort()));
|
||||
option.put(optName_, uri);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue