connect-redirecthost
Advanced tools
Comparing version 0.0.4 to 1.0.0
@@ -129,5 +129,5 @@ /*! | ||
}else{ | ||
res.redirect('http://' + to + pathFunc(host, url)); //<- change url based on host | ||
res.redirect(301, 'http://' + to + pathFunc(host, url)); //<- change url based on host | ||
} | ||
}; | ||
} |
@@ -5,3 +5,3 @@ { | ||
"description": "Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one", | ||
"version": "0.0.4", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -15,3 +15,3 @@ "url": "git@github.com:perropicante/connect-redirecthost.git" | ||
"dependencies": { | ||
"underscore" : "1.1.7" | ||
"underscore" : "1.6.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
@@ -5,2 +5,4 @@ # Connect Host Redirect | ||
[![Build Status](https://secure.travis-ci.org/perropicante/connect-redirecthost.png)](http://travis-ci.org/perropicante/connect-redirecthost) | ||
## Installation | ||
@@ -67,4 +69,4 @@ | ||
View the LICENSE file. | ||
MIT License, see the LICENSE file. | ||
@@ -14,8 +14,14 @@ /*! | ||
var res = {}; | ||
res.redirect = function(to){ | ||
res.redirect = function(statusCode, to){ | ||
this._statusCode = statusCode; | ||
this._location = to; | ||
}; | ||
res.__defineGetter__('statusCode', function(){ | ||
return this._statusCode; | ||
}); | ||
res.__defineGetter__('location', function(){ | ||
return this._location; | ||
}); | ||
return res; | ||
@@ -49,4 +55,5 @@ } | ||
middleware(req, res, failNext); | ||
assert.equal(res.statusCode, 301); | ||
assert.equal(res.location, to); | ||
assert.equal(res.location, to); | ||
}; | ||
@@ -53,0 +60,0 @@ } |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
323
1
71
15925
8
1
+ Addedunderscore@1.6.0(transitive)
- Removedunderscore@1.1.7(transitive)
Updatedunderscore@1.6.0