Skip to content
Browse files

encode URI component

  • Loading branch information...
1 parent 4e3177b commit b0f85317c543454d680eabc3ffde7dfb79a50b3a @Raynos committed
Showing with 6 additions and 4 deletions.
  1. +2 −1 networks/peerNetwork.js
  2. +2 −1 networks/relayNetwork.js
  3. +2 −2 networks/webRTCNetwork.js
View
3 networks/peerNetwork.js
@@ -8,7 +8,8 @@ function PeerNetwork(connection, channel) {
var mx = connection.mx
, networkName = connection.networkName
, localPeerId = connection.selfId
- , peerStream = mx.createStream(networkName + "/peer/echo/" + channel)
+ , peerStream = mx.createStream(networkName + "/peer/echo/" +
+ encodeURIComponent(channel))
, peerEmitter = new RemoteEventEmitter()
, network = new EventEmitter()
View
3 networks/relayNetwork.js
@@ -8,7 +8,8 @@ function RelayNetwork(connection, channel) {
var mx = connection.mx
, networkName = connection.networkName
, localPeerId = connection.selfId
- , relayStream = mx.createStream(networkName + "/relay/echo/" + channel)
+ , relayStream = mx.createStream(networkName + "/relay/echo/" +
+ encodeURIComponent(channel))
, relayEmitter = new RemoteEventEmitter()
, network = new EventEmitter()
View
4 networks/webRTCNetwork.js
@@ -10,8 +10,8 @@ function WebRTCNetwork(connection, channel) {
var mx = connection.mx
, networkName = connection.networkName
, localPeerId = connection.selfId
- , webrtcStream = mx.createStream(
- networkName + "/webrtc/echo/" + channel)
+ , webrtcStream = mx.createStream(networkName + "/webrtc/echo/" +
+ encodeURIComponent(channel))
, webrtcEmitter = new RemoteEventEmitter()
, network = new EventEmitter()

0 comments on commit b0f8531

Please sign in to comment.
Something went wrong with that request. Please try again.