Codebase list rust-libslirp / e7da949
cookie-store, reqwest: update Ximin Luo 4 years ago
7 changed file(s) with 14 addition(s) and 319 deletion(s). Raw diff Collapse all Expand all
0 rust-cookie-store (0.10.0-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
1
2 * Team upload.
3 * Package cookie_store 0.10.0 from crates.io using debcargo 2.4.0
4
5 -- Ximin Luo <infinity0@debian.org> Tue, 31 Dec 2019 05:08:38 +0000
6
07 rust-cookie-store (0.8.0-1) unstable; urgency=medium
18
29 * Package cookie_store 0.8.0 from crates.io using debcargo 2.2.10
+0
-42
src/cookie-store/debian/patches/fix-deps.patch less more
0 --- a/Cargo.toml
1 +++ b/Cargo.toml
2 @@ -24,7 +24,7 @@
3 features = ["percent-encode"]
4
5 [dependencies.idna]
6 -version = "0.1.5"
7 +version = "0.2"
8
9 [dependencies.log]
10 version = "0.4.6"
11 @@ -47,7 +47,7 @@
12 version = "0.3.2"
13
14 [dependencies.url]
15 -version = "1.7.2"
16 +version = "2"
17 [dev-dependencies.env_logger]
18 version = "0.6.0"
19
20 --- a/src/lib.rs
21 +++ b/src/lib.rs
22 @@ -11,7 +11,7 @@
23 mod utils;
24
25 #[derive(Debug)]
26 -pub struct IdnaErrors(idna::uts46::Errors);
27 +pub struct IdnaErrors(idna::Errors);
28
29 impl std::fmt::Display for IdnaErrors {
30 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31 @@ -21,8 +21,8 @@
32
33 impl std::error::Error for IdnaErrors {}
34
35 -impl From<idna::uts46::Errors> for IdnaErrors {
36 - fn from(e: idna::uts46::Errors) -> Self {
37 +impl From<idna::Errors> for IdnaErrors {
38 + fn from(e: idna::Errors) -> Self {
39 IdnaErrors(e)
40 }
41 }
+0
-88
src/cookie-store/debian/patches/replace-try_from-with-TryFrom.patch less more
0 From 11a597024e016b7060bba1dedf5d5c2389181b10 Mon Sep 17 00:00:00 2001
1 From: kpcyrd <git@rxv.cc>
2 Date: Sat, 13 Jul 2019 17:42:00 +0200
3 Subject: [PATCH] Replace try_from crate with std TryFrom
4
5 ---
6 Cargo.toml | 1 -
7 src/cookie.rs | 2 +-
8 src/cookie_domain.rs | 14 +++++++-------
9 3 files changed, 8 insertions(+), 9 deletions(-)
10
11 --- a/Cargo.toml
12 +++ b/Cargo.toml
13 @@ -43,9 +43,6 @@
14 [dependencies.time]
15 version = "0.1.42"
16
17 -[dependencies.try_from]
18 -version = "0.3.2"
19 -
20 [dependencies.url]
21 version = "2"
22 [dev-dependencies.env_logger]
23 --- a/src/cookie.rs
24 +++ b/src/cookie.rs
25 @@ -6,10 +6,10 @@
26 use cookie::{Cookie as RawCookie, CookieBuilder as RawCookieBuilder, ParseError};
27 use serde::{Deserialize, Serialize};
28 use std::borrow::Cow;
29 +use std::convert::TryFrom;
30 use std::ops::Deref;
31 use std::{error, fmt};
32 use time;
33 -use try_from::TryFrom;
34 use url::Url;
35
36 #[derive(Debug, Clone, PartialEq, Eq)]
37 --- a/src/cookie_domain.rs
38 +++ b/src/cookie_domain.rs
39 @@ -4,7 +4,7 @@
40 use idna;
41 use publicsuffix;
42 use serde::{Deserialize, Serialize};
43 -use try_from::TryFrom;
44 +use std::convert::TryFrom;
45 use url::{Host, Url};
46
47 use crate::utils::is_host_name;
48 @@ -125,8 +125,8 @@
49 /// Construct a `CookieDomain::Suffix` from a string, stripping a single leading '.' if present.
50 /// If the source string is empty, returns the `CookieDomain::Empty` variant.
51 impl<'a> TryFrom<&'a str> for CookieDomain {
52 - type Err = crate::Error;
53 - fn try_from(value: &str) -> Result<CookieDomain, Self::Err> {
54 + type Error = crate::Error;
55 + fn try_from(value: &str) -> Result<CookieDomain, Self::Error> {
56 idna::domain_to_ascii(value.trim())
57 .map_err(super::IdnaErrors::from)
58 .map_err(Into::into)
59 @@ -149,8 +149,8 @@
60 /// performing this step twice, the `From<&cookie::Cookie>` impl should be used,
61 /// instead of passing `cookie.domain` to the `From<&str>` impl.
62 impl<'a, 'c> TryFrom<&'a RawCookie<'c>> for CookieDomain {
63 - type Err = crate::Error;
64 - fn try_from(cookie: &'a RawCookie<'c>) -> Result<CookieDomain, Self::Err> {
65 + type Error = crate::Error;
66 + fn try_from(cookie: &'a RawCookie<'c>) -> Result<CookieDomain, Self::Error> {
67 if let Some(domain) = cookie.domain() {
68 idna::domain_to_ascii(domain.trim())
69 .map_err(super::IdnaErrors::from)
70 @@ -181,7 +181,7 @@
71 #[cfg(test)]
72 mod tests {
73 use cookie::Cookie as RawCookie;
74 - use try_from::TryFrom;
75 + use std::convert::TryFrom;
76 use url::Url;
77
78 use super::CookieDomain;
79 @@ -368,7 +368,7 @@
80 #[cfg(test)]
81 mod serde_tests {
82 use serde_json;
83 - use try_from::TryFrom;
84 + use std::convert::TryFrom;
85
86 use crate::cookie_domain::CookieDomain;
87 use crate::utils::test::*;
+0
-2
src/cookie-store/debian/patches/series less more
0 fix-deps.patch
1 replace-try_from-with-TryFrom.patch
0 rust-reqwest (0.10.0-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
1
2 * Team upload.
3 * Package reqwest 0.10.0 from crates.io using debcargo 2.4.0
4
5 -- Ximin Luo <infinity0@debian.org> Tue, 31 Dec 2019 05:07:51 +0000
6
07 rust-reqwest (0.9.19-2) unstable; urgency=medium
18
29 * Team upload.
+0
-186
src/reqwest/debian/patches/fix-deps.patch less more
0 From 0990b7914b589758ffab805854c5ef996b4ba316 Mon Sep 17 00:00:00 2001
1 From: Nikhil Benesch <nikhil.benesch@gmail.com>
2 Date: Tue, 30 Jul 2019 14:52:39 -0400
3 Subject: [PATCH] Upgrade to url v2.0
4
5 --- a/Cargo.toml
6 +++ b/Cargo.toml
7 @@ -33,7 +33,7 @@
8 version = "0.12.0"
9
10 [dependencies.cookie_store]
11 -version = "0.7.0"
12 +version = "0.8"
13
14 [dependencies.encoding_rs]
15 version = "0.8"
16 @@ -72,12 +72,15 @@
17 version = "0.3.7"
18
19 [dependencies.mime_guess]
20 -version = "2.0.0-alpha.6"
21 +version = "2.0.0"
22
23 [dependencies.native-tls]
24 version = "0.2"
25 optional = true
26
27 +[dependencies.percent-encoding]
28 +version = "2"
29 +
30 [dependencies.rustls]
31 version = "0.15"
32 features = ["dangerous_configuration"]
33 @@ -90,7 +93,7 @@
34 version = "1.0"
35
36 [dependencies.serde_urlencoded]
37 -version = "0.5"
38 +version = "0.6"
39
40 [dependencies.socks]
41 version = "0.3.2"
42 @@ -125,10 +128,10 @@
43 optional = true
44
45 [dependencies.url]
46 -version = "1.2"
47 +version = "2"
48
49 [dependencies.uuid]
50 -version = "0.7"
51 +version = "0.8"
52 features = ["v4"]
53
54 [dependencies.webpki-roots]
55 --- a/src/async_impl/multipart.rs
56 +++ b/src/async_impl/multipart.rs
57 @@ -3,7 +3,7 @@
58 use std::fmt;
59
60 use mime_guess::Mime;
61 -use url::percent_encoding::{self, EncodeSet, PATH_SEGMENT_ENCODE_SET};
62 +use percent_encoding::{self, AsciiSet};
63 use uuid::Uuid;
64 use http::HeaderMap;
65
66 @@ -371,31 +371,39 @@
67 }
68 }
69
70 -#[derive(Debug, Clone)]
71 -pub(crate) struct AttrCharEncodeSet;
72 +/// https://url.spec.whatwg.org/#fragment-percent-encode-set
73 +const FRAGMENT_ENCODE_SET: &AsciiSet = &percent_encoding::CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`');
74
75 -impl EncodeSet for AttrCharEncodeSet {
76 - fn contains(&self, ch: u8) -> bool {
77 - match ch as char {
78 - '!' => false,
79 - '#' => false,
80 - '$' => false,
81 - '&' => false,
82 - '+' => false,
83 - '-' => false,
84 - '.' => false,
85 - '^' => false,
86 - '_' => false,
87 - '`' => false,
88 - '|' => false,
89 - '~' => false,
90 - _ => {
91 - let is_alpha_numeric = ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a || ch >= 0x30 && ch <= 0x39;
92 - !is_alpha_numeric
93 - }
94 - }
95 - }
96 -}
97 +/// https://url.spec.whatwg.org/#path-percent-encode-set
98 +const PATH_ENCODE_SET: &AsciiSet = &FRAGMENT_ENCODE_SET.add(b'#').add(b'?').add(b'{').add(b'}');
99 +
100 +const PATH_SEGMENT_ENCODE_SET: &AsciiSet = &PATH_ENCODE_SET.add(b'/').add(b'%');
101 +
102 +// This will be a bit shorter to express when AsciiSet.remove lands:
103 +// https://github.com/servo/rust-url/pull/528.
104 +/// https://tools.ietf.org/html/rfc8187#section-3.2.1
105 +const ATTR_CHAR_ENCODE_SET: &AsciiSet = &percent_encoding::CONTROLS
106 + .add(b' ')
107 + .add(b'"')
108 + .add(b'%')
109 + .add(b'\'')
110 + .add(b'(')
111 + .add(b')')
112 + .add(b'*')
113 + .add(b',')
114 + .add(b'/')
115 + .add(b':')
116 + .add(b';')
117 + .add(b'<')
118 + .add(b'=')
119 + .add(b'>')
120 + .add(b'?')
121 + .add(b'@')
122 + .add(b'[')
123 + .add(b'\\')
124 + .add(b']')
125 + .add(b'{')
126 + .add(b'}');
127
128 pub(crate) enum PercentEncoding {
129 PathSegment,
130 @@ -443,7 +451,7 @@
131 .to_string()
132 },
133 PercentEncoding::AttrChar => {
134 - percent_encoding::utf8_percent_encode(value, AttrCharEncodeSet)
135 + percent_encoding::utf8_percent_encode(value, ATTR_CHAR_ENCODE_SET)
136 .to_string()
137 },
138 PercentEncoding::NoOp => { value.to_string() },
139 --- a/src/lib.rs
140 +++ b/src/lib.rs
141 @@ -193,6 +193,7 @@
142 extern crate mime_guess;
143 #[cfg(feature = "default-tls")]
144 extern crate native_tls;
145 +extern crate percent_encoding;
146 extern crate serde;
147 extern crate serde_json;
148 extern crate serde_urlencoded;
149 --- a/src/proxy.rs
150 +++ b/src/proxy.rs
151 @@ -5,10 +5,12 @@
152
153 use http::{header::HeaderValue, Uri};
154 use hyper::client::connect::Destination;
155 -use url::percent_encoding::percent_decode;
156 +use percent_encoding::percent_decode;
157 use {IntoUrl, Url};
158 use std::collections::HashMap;
159 use std::env;
160 +#[cfg(feature = "socks")]
161 +use std::io;
162 #[cfg(target_os = "windows")]
163 use std::error::Error;
164 #[cfg(target_os = "windows")]
165 @@ -330,11 +332,15 @@
166 // Resolve URL to a host and port
167 #[cfg(feature = "socks")]
168 let to_addr = || {
169 - let host_and_port = try_!(url.with_default_port(|url| match url.scheme() {
170 - "socks5" | "socks5h" => Ok(1080),
171 - _ => Err(())
172 - }));
173 - let mut addr = try_!(host_and_port.to_socket_addrs());
174 + let host = try_!(url.host_str().ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "URL has no host")));
175 + let port = try_!(match url.port_or_known_default() {
176 + Some(port) => Ok(port),
177 + None => match url.scheme() {
178 + "socks5" | "socks5h" => Ok(1080),
179 + _ => Err(io::Error::new(io::ErrorKind::InvalidData, "URL has no port")),
180 + }
181 + });
182 + let mut addr = try_!(format!("{}:{}", host, port).to_socket_addrs());
183 addr
184 .next()
185 .ok_or_else(::error::unknown_proxy_scheme)
+0
-1
src/reqwest/debian/patches/series less more
0 fix-deps.patch