Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions misc/multiaddr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ byteorder = "1.3.1"
bytes = "0.4.12"
data-encoding = "2.1"
multihash = { package = "parity-multihash", version = "0.1.0", path = "../multihash" }
percent-encoding = "1.0.1"
percent-encoding = "2.1.0"
serde = "1.0.70"
unsigned-varint = "0.2"
url = { version = "1.7.2", default-features = false }
url = { version = "2.1.0", default-features = false }

[dev-dependencies]
bincode = "1"
Expand Down
17 changes: 15 additions & 2 deletions misc/multiaddr/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ const WS_WITH_PATH: u32 = 4770; // Note: not standard
const WSS: u32 = 478;
const WSS_WITH_PATH: u32 = 4780; // Note: not standard

const PATH_SEGMENT_ENCODE_SET: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS
.add(b'%')
.add(b'/')
.add(b'`')
.add(b'?')
.add(b'{')
.add(b'}')
.add(b' ')
.add(b'"')
.add(b'#')
.add(b'<')
.add(b'>');

/// `Protocol` describes all possible multiaddress protocols.
///
/// For `Unix`, `Ws` and `Wss` we use `&str` instead of `Path` to allow
Expand Down Expand Up @@ -429,12 +442,12 @@ impl<'a> fmt::Display for Protocol<'a> {
Utp => f.write_str("/utp"),
Ws(ref s) if s == "/" => f.write_str("/ws"),
Ws(s) => {
let encoded = percent_encoding::percent_encode(s.as_bytes(), percent_encoding::PATH_SEGMENT_ENCODE_SET);
let encoded = percent_encoding::percent_encode(s.as_bytes(), PATH_SEGMENT_ENCODE_SET);
write!(f, "/x-parity-ws/{}", encoded)
},
Wss(ref s) if s == "/" => f.write_str("/wss"),
Wss(s) => {
let encoded = percent_encoding::percent_encode(s.as_bytes(), percent_encoding::PATH_SEGMENT_ENCODE_SET);
let encoded = percent_encoding::percent_encode(s.as_bytes(), PATH_SEGMENT_ENCODE_SET);
write!(f, "/x-parity-wss/{}", encoded)
},
}
Expand Down
2 changes: 1 addition & 1 deletion transports/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tokio-codec = "0.1.1"
tokio-io = "0.1.12"
tokio-rustls = "0.10.0-alpha.3"
soketto = { version = "0.2.3", features = ["deflate"] }
url = "1.7.2"
url = "2.1.0"
webpki-roots = "0.16.0"

[dev-dependencies]
Expand Down