@lodestar/utils 1.13.0-dev.fa30bcf100 → 1.13.0-dev.fa702dfeb0

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.
package/lib/validation.js CHANGED
@@ -2,6 +2,15 @@ export function isValidHttpUrl(urlStr) {
2
2
  let url;
3
3
  try {
4
4
  url = new URL(urlStr);
5
+ // `new URL` encodes the username/password with the userinfo percent-encode set.
6
+ // This means the `%` character is not encoded, but others are (such as `=`).
7
+ // If a username/password contain a `%`, they will not be able to be decoded.
8
+ //
9
+ // Make sure that we can successfully decode the username and password here.
10
+ //
11
+ // Unfortunately this means we don't accept every character supported by RFC-3986.
12
+ decodeURIComponent(url.username);
13
+ decodeURIComponent(url.password);
5
14
  }
6
15
  catch (_) {
7
16
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,GAAG,CAAC;IACR,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC"}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,GAAG,CAAC;IACR,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAEtB,gFAAgF;QAChF,6EAA6E;QAC7E,6EAA6E;QAC7E,EAAE;QACF,4EAA4E;QAC5E,EAAE;QACF,kFAAkF;QAClF,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KAClC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/ChainSafe/lodestar/issues"
13
13
  },
14
- "version": "1.13.0-dev.fa30bcf100",
14
+ "version": "1.13.0-dev.fa702dfeb0",
15
15
  "type": "module",
16
16
  "exports": "./lib/index.js",
17
17
  "files": [
@@ -55,5 +55,5 @@
55
55
  "beacon",
56
56
  "blockchain"
57
57
  ],
58
- "gitHead": "09adc314ddea2288841259c2091c2f16a730e267"
58
+ "gitHead": "5d700ce520fa0c9627f13d12ad4a6c0acdbd876d"
59
59
  }