@mountainpass/addressr 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,7 +95,12 @@ function buildClientOptions(environment) {
95
95
  const protocol = environment[PROTOCOL_VAR] || 'https';
96
96
  const username = environment[USERNAME_VAR];
97
97
  const password = environment[PASSWORD_VAR];
98
- const node = isNonEmpty(username) ? `${protocol}://${username}:${password}@${host}:${port}` : `${protocol}://${host}:${port}`;
98
+ // P035 production-discovered bug: base64-derived passwords commonly contain
99
+ // '/', '+', '=', ':' which are URL-reserved. Without encoding, the resulting
100
+ // node URL `https://user:pa/ss@host:443` makes `new Client(...)` throw
101
+ // synchronously (URL parser treats '/' as path delimiter). Encode the
102
+ // credentials so any password the operator generates is safe.
103
+ const node = isNonEmpty(username) ? `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${host}:${port}` : `${protocol}://${host}:${port}`;
99
104
  return {
100
105
  node
101
106
  };
package/lib/version.js CHANGED
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '2.6.0';
8
+ const version = exports.version = '2.6.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mountainpass/addressr",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Australian Address Validation, Search and Autocomplete",
5
5
  "author": {
6
6
  "name": "Mountain Pass",