Skip to content

Commit

Permalink
Merge pull request #839 from DavidTPate/ip-literals-uri-brackets
Browse files Browse the repository at this point in the history
Add Negative Tests for IP Literals in URIs
  • Loading branch information
Marsup committed Mar 1, 2016
2 parents cc33e4b + 266ee56 commit 2d9431e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,7 @@ describe('string', () => {
['ftp://ftp.is.co.za/rfc/rfc1808.txt', true],
['http://www.ietf.org/rfc/rfc2396.txt', true],
['ldap://[2001:db8::7]/c=GB?objectClass?one', true],
['ldap://2001:db8::7/c=GB?objectClass?one', false],
['mailto:[email protected]', true],
['news:comp.infosystems.www.servers.unix', true],
['tel:+1-816-555-1212', true],
Expand All @@ -1438,6 +1439,10 @@ describe('string', () => {
['http://[a:b:c:d:e::1.2.3.4]', true],
['coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]', true],
['http://[1080:0:0:0:8:800:200C:417A]', true],
['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
['http://a:b:c:d:e::1.2.3.4', false],
['coap://FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', false],
['http://1080:0:0:0:8:800:200C:417A', false],
['http://127.0.0.1:8000/foo?bar', true],
['http://asdf:qwer@localhost:8000', true],
['http://user:pass%3A@localhost:80', true],
Expand Down Expand Up @@ -1467,8 +1472,10 @@ describe('string', () => {
['http://_jabber._tcp.google.com:80/test', true],
['http://user:pass@_jabber._tcp.google.com:80/test', true],
['http://[fe80::1]/a/b?a=b#abc', true],
['http://fe80::1/a/b?a=b#abc', false],
['http://user:password@[3ffe:2a00:100:7031::1]:8080', true],
['coap://[1080:0:0:0:8:800:200C:417A]:61616/', true],
['coap://1080:0:0:0:8:800:200C:417A:61616/', false],
['git+http:/joyent/node.git', true],
['http://bucket_name.s3.amazonaws.com/image.jpg', true],
['dot.test://foo/bar', true],
Expand Down

0 comments on commit 2d9431e

Please sign in to comment.