Fix Wget for Internationalized Domain Names.
GitOrigin-RevId: 8be2d49b41bc3e6d2d3351833ab35bcf43c9b5f7
This commit is contained in:
parent
7e0e2d2b6a
commit
536508193a
@ -21,6 +21,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
Wget::Wget(Promise<HttpQueryPtr> promise, string url, std::vector<std::pair<string, string>> headers, int32 timeout_in,
|
Wget::Wget(Promise<HttpQueryPtr> promise, string url, std::vector<std::pair<string, string>> headers, int32 timeout_in,
|
||||||
int32 ttl, SslFd::VerifyPeer verify_peer)
|
int32 ttl, SslFd::VerifyPeer verify_peer)
|
||||||
: promise_(std::move(promise))
|
: promise_(std::move(promise))
|
||||||
@ -34,6 +35,8 @@ Wget::Wget(Promise<HttpQueryPtr> promise, string url, std::vector<std::pair<stri
|
|||||||
Status Wget::try_init() {
|
Status Wget::try_init() {
|
||||||
string input_url = input_url_;
|
string input_url = input_url_;
|
||||||
TRY_RESULT(url, parse_url(MutableSlice(input_url)));
|
TRY_RESULT(url, parse_url(MutableSlice(input_url)));
|
||||||
|
TRY_RESULT(ascii_host, idn_to_ascii(url.host_));
|
||||||
|
url.host_ = std::move(ascii_host);
|
||||||
|
|
||||||
IPAddress addr;
|
IPAddress addr;
|
||||||
TRY_STATUS(addr.init_host_port(url.host_, url.port_));
|
TRY_STATUS(addr.init_host_port(url.host_, url.port_));
|
||||||
@ -133,4 +136,5 @@ void Wget::tear_down() {
|
|||||||
on_error(Status::Error("Cancelled"));
|
on_error(Status::Error("Cancelled"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
Loading…
Reference in New Issue
Block a user