Skip to content
Snippets Groups Projects
Commit e87ec658 authored by David Fifield's avatar David Fifield
Browse files

Use URLSearchParams.toString instead of Query.buildString.

parent fdc5563f
No related branches found
No related tags found
No related merge requests found
/* global log */
/* exported Query, Params, DummyRateLimit */
/* exported Params, DummyRateLimit */
/*
A JavaScript WebRTC snowflake proxy
......@@ -50,22 +50,6 @@ Util.TBB_UAS = [
];
class Query {
// params is a list of (key, value) 2-tuples.
static buildString(params) {
var i, len, param, parts;
parts = [];
for (i = 0, len = params.length; i < len; i++) {
param = params[i];
parts.push(encodeURIComponent(param[0]) + '=' + encodeURIComponent(param[1]));
}
return parts.join('&');
}
}
class Parse {
// Parse a cookie data string (usually document.cookie). The return type is an
......
/* global Query */
/*
Only websocket-specific stuff.
*/
......@@ -36,7 +34,7 @@ class WS {
}
if (void 0 !== params) {
parts.push('?');
parts.push(Query.buildString(params));
parts.push(new URLSearchParams(params).toString());
}
return parts.join('');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment