mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 01:21:21 +00:00
Fix the multiaddr parsing in the JS snippet (#1824)
* Fix the multiaddr parsing in the JS snippet * Update CHANGELOG
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
# 0.24.0 [unreleased]
|
||||
|
||||
- Fix the WebSocket implementation parsing `x-parity-ws` multiaddresses as `x-parity-wss`.
|
||||
- Update dependencies.
|
||||
|
||||
# 0.23.0 [2020-10-16]
|
||||
|
@ -34,7 +34,7 @@ const multiaddr_to_ws = (addr) => {
|
||||
let parsed = addr.match(/^\/(ip4|ip6|dns4|dns6|dns)\/(.*?)\/tcp\/(.*?)\/(ws|wss|x-parity-ws\/(.*)|x-parity-wss\/(.*))$/);
|
||||
if (parsed != null) {
|
||||
let proto = 'wss';
|
||||
if (parsed[4] == 'ws' || parsed[4] == 'x-parity-ws') {
|
||||
if (parsed[4] == 'ws' || parsed[4].startsWith('x-parity-ws/')) {
|
||||
proto = 'ws';
|
||||
}
|
||||
let url = decodeURIComponent(parsed[5] || parsed[6] || '');
|
||||
|
Reference in New Issue
Block a user