mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Remove unused Params.getAddress.
It was formerly used for the "broker" and "relay" query string
parameters, which were removed in
debe9c3748
.
This commit is contained in:
parent
d6d42e82aa
commit
c1f6548602
2 changed files with 0 additions and 40 deletions
|
@ -244,33 +244,4 @@ describe('Params', function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('address', function() {
|
|
||||||
|
|
||||||
var DEFAULT = {
|
|
||||||
host: '1.1.1.1',
|
|
||||||
port: 2222
|
|
||||||
};
|
|
||||||
|
|
||||||
var getAddress = function(query) {
|
|
||||||
return Params.getAddress(query, 'addr', DEFAULT);
|
|
||||||
};
|
|
||||||
|
|
||||||
it('parses correctly', function() {
|
|
||||||
expect(getAddress({})).toEqual(DEFAULT);
|
|
||||||
expect(getAddress({
|
|
||||||
addr: '3.3.3.3:4444'
|
|
||||||
})).toEqual({
|
|
||||||
host: '3.3.3.3',
|
|
||||||
port: 4444
|
|
||||||
});
|
|
||||||
expect(getAddress({
|
|
||||||
x: '3.3.3.3:4444'
|
|
||||||
})).toEqual(DEFAULT);
|
|
||||||
expect(getAddress({
|
|
||||||
addr: '---'
|
|
||||||
})).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -238,17 +238,6 @@ class Params {
|
||||||
return Parse.byteCount(spec);
|
return Parse.byteCount(spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get an object value and parse it as an address spec. Returns |defaultValue|
|
|
||||||
// if param is not a key. Returns null on a parsing error.
|
|
||||||
static getAddress(query, param, defaultValue) {
|
|
||||||
var val;
|
|
||||||
val = query[param];
|
|
||||||
if (void 0 === val) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
return Parse.address(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get an object value and return it as a string. Returns default_val if param
|
// Get an object value and return it as a string. Returns default_val if param
|
||||||
// is not a key.
|
// is not a key.
|
||||||
static getString(query, param, defaultValue) {
|
static getString(query, param, defaultValue) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue