diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-08-22 16:01:33 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-08-22 16:01:33 +0200 |
commit | b9533ec27e341d8c62be205a0feb30b0b11a5b1d (patch) | |
tree | 1bafa2069d7dfdf41161324e95e0c018660d74ef /net | |
parent | 678ab880085697c8f70da656ce16c4b8c38e45c9 (diff) |
Bump percent-encoding to 2.1.
Diffstat (limited to 'net')
-rw-r--r-- | net/Cargo.toml | 2 | ||||
-rw-r--r-- | net/src/lib.rs | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/net/Cargo.toml b/net/Cargo.toml index 6389bbfa..6750810f 100644 --- a/net/Cargo.toml +++ b/net/Cargo.toml @@ -34,7 +34,7 @@ hyper-tls = "0.3" libc = "0.2.33" native-tls = "0.2.0" nettle = "5.0" -percent-encoding = "1.0.1" +percent-encoding = "2.1" tokio-core = "0.1" tokio-io = "0.1.4" url = "2.1" diff --git a/net/src/lib.rs b/net/src/lib.rs index e37e6ece..771b7d9f 100644 --- a/net/src/lib.rs +++ b/net/src/lib.rs @@ -49,7 +49,6 @@ extern crate native_tls; extern crate nettle; extern crate tokio_core; extern crate tokio_io; -#[macro_use] extern crate percent_encoding; extern crate url; extern crate zbase32; @@ -60,7 +59,8 @@ use hyper::header::{CONTENT_LENGTH, CONTENT_TYPE, HeaderValue}; use hyper::{Client, Body, StatusCode, Request}; use hyper_tls::HttpsConnector; use native_tls::{Certificate, TlsConnector}; -use percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; +use percent_encoding::{percent_encode, AsciiSet, CONTROLS}; + use std::convert::From; use std::io::Cursor; use url::Url; @@ -72,13 +72,14 @@ use sequoia_core::{Context, NetworkPolicy}; pub mod wkd; -define_encode_set! { - /// Encoding used for submitting keys. - /// - /// The SKS keyserver as of version 1.1.6 is a bit picky with - /// respect to the encoding. - pub KEYSERVER_ENCODE_SET = [DEFAULT_ENCODE_SET] | {'-', '+', '/' } -} +/// https://url.spec.whatwg.org/#fragment-percent-encode-set +const KEYSERVER_ENCODE_SET: &AsciiSet = + // Formerly DEFAULT_ENCODE_SET + &CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>').add(b'`') + .add(b'?').add(b'{').add(b'}') + // The SKS keyserver as of version 1.1.6 is a bit picky with + // respect to the encoding. + .add(b'-').add(b'+').add(b'/'); /// For accessing keyservers using HKP. pub struct KeyServer { |