summaryrefslogtreecommitdiffstats
path: root/net/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-08-22 16:01:33 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-08-22 16:01:33 +0200
commitb9533ec27e341d8c62be205a0feb30b0b11a5b1d (patch)
tree1bafa2069d7dfdf41161324e95e0c018660d74ef /net/src
parent678ab880085697c8f70da656ce16c4b8c38e45c9 (diff)
Bump percent-encoding to 2.1.
Diffstat (limited to 'net/src')
-rw-r--r--net/src/lib.rs19
1 files changed, 10 insertions, 9 deletions
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 {