+1
-1
@@ -270,3 +270,3 @@ 'use strict' | ||
| try { | ||
| parsed.host = URL.domainToASCII(parsed.host.toLowerCase()) | ||
| parsed.host = new URL('http://' + parsed.host).hostname | ||
| } catch (e) { | ||
@@ -273,0 +273,0 @@ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e |
+1
-1
| { | ||
| "name": "fast-uri", | ||
| "description": "Dependency free RFC 3986 URI toolbox", | ||
| "version": "2.4.1", | ||
| "version": "2.4.2", | ||
| "main": "index.js", | ||
@@ -6,0 +6,0 @@ "type": "commonjs", |
@@ -135,1 +135,29 @@ 'use strict' | ||
| }) | ||
| test('parse canonicalises IDN / Unicode hosts to their ASCII form', (t) => { | ||
| const cases = [ | ||
| { | ||
| input: 'http://127。0。0。1/', | ||
| expectedHost: '127.0.0.1', | ||
| description: 'full-width ideographic stops as octet separators' | ||
| }, | ||
| { | ||
| input: 'http://example.com/', | ||
| expectedHost: 'example.com', | ||
| description: 'fullwidth e as first letter' | ||
| }, | ||
| { | ||
| input: 'http://納豆.example.org/', | ||
| expectedHost: 'xn--99zt52a.example.org', | ||
| description: 'CJK label requiring punycode' | ||
| } | ||
| ] | ||
| t.plan(cases.length * 2) | ||
| cases.forEach(({ input, expectedHost, description }) => { | ||
| const parsed = fastURI.parse(input) | ||
| t.notOk(parsed.error, `parse should not set error: ${description}`) | ||
| t.equal(parsed.host, expectedHost, `host canonicalised to ASCII: ${description}`) | ||
| }) | ||
| }) |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
119975
0.7%2632
0.96%