Skip to content

Commit 2d9431e

Browse files
committed
Merge pull request #839 from DavidTPate/ip-literals-uri-brackets
Add Negative Tests for IP Literals in URIs
2 parents cc33e4b + 266ee56 commit 2d9431e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/string.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ describe('string', () => {
14261426
['ftp://ftp.is.co.za/rfc/rfc1808.txt', true],
14271427
['http://www.ietf.org/rfc/rfc2396.txt', true],
14281428
['ldap://[2001:db8::7]/c=GB?objectClass?one', true],
1429+
['ldap://2001:db8::7/c=GB?objectClass?one', false],
14291430
['mailto:[email protected]', true],
14301431
['news:comp.infosystems.www.servers.unix', true],
14311432
['tel:+1-816-555-1212', true],
@@ -1438,6 +1439,10 @@ describe('string', () => {
14381439
['http://[a:b:c:d:e::1.2.3.4]', true],
14391440
['coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]', true],
14401441
['http://[1080:0:0:0:8:800:200C:417A]', true],
1442+
['http://v1.09azAZ-._~!$&\'()*+,;=:', true], // This doesn't look valid, but it is. The `v1.09azAZ-._~!$&\'()*+,;=` part is a valid registered name as it has no invalid characters
1443+
['http://a:b:c:d:e::1.2.3.4', false],
1444+
['coap://FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', false],
1445+
['http://1080:0:0:0:8:800:200C:417A', false],
14411446
['http://127.0.0.1:8000/foo?bar', true],
14421447
['http://asdf:qwer@localhost:8000', true],
14431448
['http://user:pass%3A@localhost:80', true],
@@ -1467,8 +1472,10 @@ describe('string', () => {
14671472
['http://_jabber._tcp.google.com:80/test', true],
14681473
['http://user:pass@_jabber._tcp.google.com:80/test', true],
14691474
['http://[fe80::1]/a/b?a=b#abc', true],
1475+
['http://fe80::1/a/b?a=b#abc', false],
14701476
['http://user:password@[3ffe:2a00:100:7031::1]:8080', true],
14711477
['coap://[1080:0:0:0:8:800:200C:417A]:61616/', true],
1478+
['coap://1080:0:0:0:8:800:200C:417A:61616/', false],
14721479
['git+http://github.com/joyent/node.git', true],
14731480
['http://bucket_name.s3.amazonaws.com/image.jpg', true],
14741481
['dot.test://foo/bar', true],

0 commit comments

Comments
 (0)