Skip to content

Commit

Permalink
Fixed an issue with parsing an empty port.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidTPate committed Aug 19, 2014
1 parent 9808555 commit f132a0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var simplePathPattern = /^(\/?[a-z0-9-._~!$&'()*+,;=:@%\/]+)(\?([a-z0-9!$&'()*+-,;=:\[\]@\/\?%]+)?)?(#[a-z0-9!$&'()*+,;=:#-\[\]@\/\?%]+)?$/i,
giantPattern = /^([a-z0-9\.\+-]+:)?\/\/(([a-z0-9!$&'()*+-,;=#\[\]@\/\?%]+:[a-z0-9!$&'()*+-,;=#\[\]@\/\?%]+)@)?([a-z0-9\-\._]+)(:([0-9]+))?(\/([a-z0-9-._~!$&'()*+,;=:@%\/]+)?)?(\?[a-z0-9!$&'()*+-,;=:\[\]@\/\?%]+)?(#[a-z0-9!$&'()*+,;=:#-\[\]@\/\?%]+)?$/i,
giantPattern = /^([a-z0-9\.\+-]+:)?\/\/(([a-z0-9!$&'()*+-,;=#\[\]@\/\?%]+:[a-z0-9!$&'()*+-,;=#\[\]@\/\?%]+)@)?([a-z0-9\-\._]+)(:([0-9]+)?)?(\/([a-z0-9-._~!$&'()*+,;=:@%\/]+)?)?(\?[a-z0-9!$&'()*+-,;=:\[\]@\/\?%]+)?(#[a-z0-9!$&'()*+,;=:#-\[\]@\/\?%]+)?$/i,
protocolPattern = /^[a-z0-9\.\+-]+:/i,
queryStringPartPattern = /\??([^\?\=\&]+)\=?([^\=\&]+)?/g;

Expand Down
2 changes: 1 addition & 1 deletion test/test-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('Node.js URL Tests', function () {
(!!!parsed.hash).should.be.true;
parsed.href.should.be.exactly('www.example.com');
});
it.skip('should parse an absolute URL with an empty port', function () {
it('should parse an absolute URL with an empty port', function () {
var parsed = decomposeUrl.parse('http://example.com:');

parsed.protocol.should.be.exactly('http:');
Expand Down

0 comments on commit f132a0f

Please sign in to comment.