Comparing version 6.3.0 to 6.3.1
@@ -65,3 +65,3 @@ /*global btoa*/ | ||
if (fragments.length > 0) { | ||
var matchUrl = fragments[0].match(/^(https?:)\/\/(?:([^:@\/]+(?::[^@\/]+?))@)?((?:[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?\.)+[a-z][\-a-z]*[a-z]|(?:(?:[0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}(?:[0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5]))(:\d{1,5})?(\/[\w\-\.~%!$&'\(\)*+,;=:@\/]*(?:\?[\w\-\.~%!$&'\(\)*+,;=:@\/?]*)?(?:#[\w\-\.~%!$&'\(\)*+,;=:@\/?#]*)?)?$/); | ||
var matchUrl = fragments[0].match(/^(https?:)\/\/(?:([^:@\/]+(?::[^@\/]+?))@)?((?:[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?\.)*[a-z][\-a-z]*[a-z]|(?:(?:[0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}(?:[0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5]))(:\d{1,5})?(\/[\w\-\.~%!$&'\(\)*+,;=:@\/]*(?:\?[\w\-\.~%!$&'\(\)*+,;=:@\/?]*)?(?:#[\w\-\.~%!$&'\(\)*+,;=:@\/?#]*)?)?$/); | ||
if (matchUrl) { | ||
@@ -68,0 +68,0 @@ var protocol = matchUrl[1], |
{ | ||
"name": "messy", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "Object model for HTTP and RFC822 messages", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -180,2 +180,15 @@ /*global describe, it*/ | ||
describe('with a url passed in the request line', function () { | ||
it('should support a localhost url', function () { | ||
var httpRequest = new HttpRequest('GET http://localhost:3000/'); | ||
expect(httpRequest.headers.get('Host'), 'to equal', 'localhost:3000'); | ||
expect(httpRequest.host, 'to equal', 'localhost'); | ||
expect(httpRequest.port, 'to equal', 3000); | ||
}); | ||
it('should support a url with an IP address', function () { | ||
var httpRequest = new HttpRequest('GET http://99.88.77.66/'); | ||
expect(httpRequest.headers.get('Host'), 'to equal', '99.88.77.66'); | ||
expect(httpRequest.host, 'to equal', '99.88.77.66'); | ||
}); | ||
it('should set the Host header', function () { | ||
@@ -182,0 +195,0 @@ var httpRequest = new HttpRequest('GET http://foo.com/'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147207
3066