New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

forcedomain

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forcedomain - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

lib/redirect.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc