forcedomain
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -16,3 +16,3 @@ 'use strict'; | ||
protocol: 'http', | ||
type: 'temporary' | ||
type: 'permanent' | ||
}); | ||
@@ -19,0 +19,0 @@ |
{ | ||
"name": "forcedomain", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "forcedomain is a middleware for Connect and Express that redirects any requests to a default domain.", | ||
@@ -25,2 +25,6 @@ "contributors": [ | ||
"email": "jelle@jellekralt.nl" | ||
}, | ||
{ | ||
"name": "Pierre de la Martinière", | ||
"email": "pierre.de.la.martiniere@gmail.com" | ||
} | ||
@@ -37,3 +41,3 @@ ], | ||
"grunt": "0.4.5", | ||
"supertest": "1.0.1", | ||
"supertest": "1.1.0", | ||
"tourism": "0.21.0" | ||
@@ -40,0 +44,0 @@ }, |
@@ -49,3 +49,3 @@ 'use strict'; | ||
test('redirects temporarily on any other host.', function (done) { | ||
test('redirects permanently on any other host.', function (done) { | ||
request(app). | ||
@@ -55,4 +55,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('http://www.example.com/'); | ||
@@ -101,3 +101,3 @@ res.resume(); | ||
test('redirects temporarily on correct host, but other port.', function (done) { | ||
test('redirects permanently on correct host, but other port.', function (done) { | ||
request(app). | ||
@@ -107,4 +107,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('http://www.example.com:4000/'); | ||
@@ -116,3 +116,3 @@ res.resume(); | ||
test('redirects temporarily on any other host.', function (done) { | ||
test('redirects permanently on any other host.', function (done) { | ||
request(app). | ||
@@ -122,4 +122,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('http://www.example.com:4000/'); | ||
@@ -172,4 +172,4 @@ res.resume(); | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com:4000/'); | ||
@@ -181,3 +181,3 @@ res.resume(); | ||
test('redirects temporarily on correct host, but other protocol.', function (done) { | ||
test('redirects permanently on correct host, but other protocol.', function (done) { | ||
request(app). | ||
@@ -187,4 +187,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -196,3 +196,3 @@ res.resume(); | ||
test('redirects temporarily on any other host, other protocol.', function (done) { | ||
test('redirects permanently on any other host, other protocol.', function (done) { | ||
request(app). | ||
@@ -202,4 +202,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -211,3 +211,3 @@ res.resume(); | ||
test('redirects temporarily on any other host, same protocol.', function (done) { | ||
test('redirects permanently on any other host, same protocol.', function (done) { | ||
request(appHttps). | ||
@@ -217,4 +217,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -287,3 +287,3 @@ res.resume(); | ||
test('redirects temporarily on correct host, but other port.', function (done) { | ||
test('redirects permanently on correct host, but other port.', function (done) { | ||
request(appHttps). | ||
@@ -293,4 +293,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com:4000/'); | ||
@@ -302,3 +302,3 @@ res.resume(); | ||
test('redirects temporarily on any other host.', function (done) { | ||
test('redirects permanently on any other host.', function (done) { | ||
request(appHttps). | ||
@@ -308,4 +308,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com:4000/'); | ||
@@ -348,4 +348,4 @@ res.resume(); | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com:4000/'); | ||
@@ -357,3 +357,3 @@ res.resume(); | ||
test('redirects temporarily on correct host, but other protocol.', function (done) { | ||
test('redirects permanently on correct host, but other protocol.', function (done) { | ||
request(app). | ||
@@ -363,4 +363,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -372,3 +372,3 @@ res.resume(); | ||
test('redirects temporarily on any other host, other protocol.', function (done) { | ||
test('redirects permanently on any other host, other protocol.', function (done) { | ||
request(app). | ||
@@ -378,4 +378,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -387,3 +387,3 @@ res.resume(); | ||
test('redirects temporarily on any other host, same protocol.', function (done) { | ||
test('redirects permanently on any other host, same protocol.', function (done) { | ||
request(app). | ||
@@ -394,4 +394,4 @@ get('/'). | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(res.header.location).is.equalTo('https://www.example.com/'); | ||
@@ -417,3 +417,3 @@ res.resume(); | ||
suite('permanent redirects', function () { | ||
suite('temporary redirects', function () { | ||
var app = express(); | ||
@@ -423,3 +423,3 @@ | ||
hostname: 'www.example.com', | ||
type: 'permanent' | ||
type: 'temporary' | ||
})); | ||
@@ -460,4 +460,4 @@ | ||
end(function (err, res) { | ||
assert.that(err).is.not.null(); | ||
assert.that(res.statusCode).is.equalTo(301); | ||
assert.that(err).is.null(); | ||
assert.that(res.statusCode).is.equalTo(307); | ||
assert.that(res.header.location).is.equalTo('http://www.example.com/'); | ||
@@ -464,0 +464,0 @@ res.resume(); |
@@ -59,3 +59,3 @@ 'use strict'; | ||
})).is.equalTo({ | ||
type: 'temporary', | ||
type: 'permanent', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -71,3 +71,3 @@ }); | ||
})).is.equalTo({ | ||
type: 'temporary', | ||
type: 'permanent', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -83,3 +83,3 @@ }); | ||
})).is.equalTo({ | ||
type: 'temporary', | ||
type: 'permanent', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -96,5 +96,5 @@ }); | ||
port: 4000, | ||
type: 'permanent' | ||
type: 'temporary' | ||
})).is.equalTo({ | ||
type: 'permanent', | ||
type: 'temporary', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -109,5 +109,5 @@ }); | ||
port: 4000, | ||
type: 'permanent' | ||
type: 'temporary' | ||
})).is.equalTo({ | ||
type: 'permanent', | ||
type: 'temporary', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -122,5 +122,5 @@ }); | ||
port: 4000, | ||
type: 'permanent' | ||
type: 'temporary' | ||
})).is.equalTo({ | ||
type: 'permanent', | ||
type: 'temporary', | ||
url: 'http://www.thenativeweb.io:4000/foo/bar' | ||
@@ -135,5 +135,5 @@ }); | ||
protocol: 'https', | ||
type: 'permanent' | ||
type: 'temporary' | ||
})).is.equalTo({ | ||
type: 'permanent', | ||
type: 'temporary', | ||
url: 'https://thenativeweb.io/foo/bar' | ||
@@ -140,0 +140,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
34734
2