mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Bug 31126: Use URLSearchParams instead of Query.parse.
This standard interface does the same thing as Query.parse did, with a different API on the return value. It doesn't have the problems with keys inherited from Object.prototype that Query.parse did.
This commit is contained in:
parent
76b81bcf77
commit
fdc5563f87
4 changed files with 11 additions and 117 deletions
|
@ -1,4 +1,4 @@
|
|||
/* global TESTING, Util, Query, Params, Config, DebugUI, BadgeUI, UI, Broker, Snowflake */
|
||||
/* global TESTING, Util, Params, Config, DebugUI, BadgeUI, UI, Broker, Snowflake */
|
||||
|
||||
/*
|
||||
Entry point.
|
||||
|
@ -15,7 +15,7 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
|
|||
|
||||
snowflake = null;
|
||||
|
||||
query = Query.parse(location.search.substr(1));
|
||||
query = new URLSearchParams(location.search);
|
||||
|
||||
debug = Params.getBool(query, 'debug', false);
|
||||
|
||||
|
@ -38,7 +38,7 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
|
|||
init = function() {
|
||||
var broker, config, ui;
|
||||
config = new Config;
|
||||
if ('off' !== query['ratelimit']) {
|
||||
if ('off' !== query.get('ratelimit')) {
|
||||
config.rateLimitBytes = Params.getByteCount(query, 'ratelimit', config.rateLimitBytes);
|
||||
}
|
||||
ui = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue