Codebase list rust-libslirp / e17f617
publicsuffix: update Ximin Luo 4 years ago
6 changed file(s) with 8 addition(s) and 109 deletion(s). Raw diff Collapse all Expand all
0 rust-publicsuffix (1.5.4-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
1
2 * Team upload.
3 * Package publicsuffix 1.5.4 from crates.io using debcargo 2.4.0
4
5 -- Ximin Luo <infinity0@debian.org> Tue, 31 Dec 2019 05:21:23 +0000
6
07 rust-publicsuffix (1.5.2-1) unstable; urgency=medium
18
29 * Team upload.
00 overlay = "."
11 uploaders = ["kpcyrd <git@rxv.cc>"]
2 allow_prerelease_deps=true
+0
-20
src/publicsuffix/debian/patches/fix-deps.patch less more
0 --- a/Cargo.toml
1 +++ b/Cargo.toml
2 @@ -24,7 +24,7 @@
3 version = "0.12"
4
5 [dependencies.idna]
6 -version = "0.1"
7 +version = "0.2"
8
9 [dependencies.lazy_static]
10 version = "1.0"
11 @@ -37,7 +37,7 @@
12 version = "1.0"
13
14 [dependencies.url]
15 -version = "1.7"
16 +version = "2"
17 [dev-dependencies.rspec]
18 version = "=1.0.0-beta.3"
19
+0
-3
src/publicsuffix/debian/patches/series less more
0 fix-deps.patch
1 upgrade-to-url-2.patch
2 upgrade-to-idna-0.2.0.patch
+0
-38
src/publicsuffix/debian/patches/upgrade-to-idna-0.2.0.patch less more
0 --- a/src/lib.rs
1 +++ b/src/lib.rs
2 @@ -96,7 +96,7 @@
3 use errors::{ErrorKind, ResultExt};
4 #[cfg(feature = "remote_list")]
5 use native_tls::TlsConnector;
6 -use idna::{domain_to_unicode, uts46};
7 +use idna::{domain_to_unicode, Config, Errors};
8 use url::Url;
9
10 /// The official URL of the list
11 @@ -675,11 +675,10 @@
12 }
13
14 fn to_ascii(domain: &str) -> Result<String> {
15 - let result = uts46::to_ascii(domain, uts46::Flags {
16 - use_std3_ascii_rules: false,
17 - transitional_processing: true,
18 - verify_dns_length: true,
19 - });
20 + let result = idna::Config::default()
21 + .transitional_processing(true)
22 + .verify_dns_length(true)
23 + .to_ascii(domain);
24 result.map_err(|error| ErrorKind::Uts46(error).into())
25 }
26
27 --- a/src/errors.rs
28 +++ b/src/errors.rs
29 @@ -34,7 +34,7 @@
30 display("invalid domain: '{}'", t)
31 }
32
33 - Uts46(t: ::idna::uts46::Errors) {
34 + Uts46(t: ::idna::Errors) {
35 description("UTS #46 processing failed")
36 display("UTS #46 processing error: '{:?}'", t)
37 }
+0
-48
src/publicsuffix/debian/patches/upgrade-to-url-2.patch less more
0 From 40324fa21590d14630a152bbf39dc0e12b3d27a0 Mon Sep 17 00:00:00 2001
1 From: Nikhil Benesch <nikhil.benesch@gmail.com>
2 Date: Tue, 30 Jul 2019 11:44:43 -0400
3 Subject: [PATCH] Upgrade to url v2.0
4
5 The upgrade is mostly smooth, except support for converting a URL to
6 socket addresses has annoyingly been removed.
7 ---
8 Cargo.toml | 2 +-
9 src/errors.rs | 2 ++
10 src/lib.rs | 6 +++++-
11 3 files changed, 8 insertions(+), 2 deletions(-)
12
13 diff --git a/src/errors.rs b/src/errors.rs
14 index 4c96fff..ff230f4 100644
15 --- a/src/errors.rs
16 +++ b/src/errors.rs
17 @@ -18,6 +18,8 @@ error_chain! {
18
19 NoHost { }
20
21 + NoPort { }
22 +
23 InvalidHost { }
24
25 InvalidEmail { }
26 diff --git a/src/lib.rs b/src/lib.rs
27 index 0619514..2fbe827 100644
28 --- a/src/lib.rs
29 +++ b/src/lib.rs
30 @@ -227,12 +227,16 @@ impl IntoUrl for String {
31 #[cfg(feature = "remote_list")]
32 fn request<U: IntoUrl>(u: U) -> Result<String> {
33 let url = u.into_url()?;
34 - let addr = url.with_default_port(|_| Err(()))?;
35 let host = match url.host_str() {
36 Some(host) => host,
37 None => { return Err(ErrorKind::NoHost.into()); }
38 };
39 + let port = match url.port_or_known_default() {
40 + Some(port) => port,
41 + None => { return Err(ErrorKind::NoPort.into()); }
42 + };
43 let data = format!("GET {} HTTP/1.0\r\nHost: {}\r\n\r\n", url.path(), host);
44 + let addr = format!("{}:{}", host, port);
45 let stream = TcpStream::connect(addr)?;
46 let timeout = Duration::from_secs(2);
47 stream.set_read_timeout(Some(timeout))?;