Comparing version 2.1.4 to 2.1.5
{ | ||
"name": "inert", | ||
"description": "Static file and directory handlers plugin for hapi.js", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"repository": "git://github.com/hapijs/inert", | ||
"main": "index", | ||
"main": "lib/index.js", | ||
"keywords": [ | ||
@@ -23,3 +23,3 @@ "file", | ||
"joi": "6.x.x", | ||
"lru-cache": "2.5.x" | ||
"lru-cache": "2.6.x" | ||
}, | ||
@@ -35,8 +35,3 @@ "devDependencies": { | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "BSD", | ||
"url": "http://github.com/hapijs/inert/raw/master/LICENSE" | ||
} | ||
] | ||
"license": "BSD-3-Clause" | ||
} |
@@ -104,4 +104,16 @@ // Load modules | ||
var server = provisionServer(); | ||
server.route({ method: 'GET', path: '/multiple/{path*}', handler: { directory: { path: function () { return ['./', '../']; }, listing: true } } }); | ||
server.route({ | ||
method: 'GET', | ||
path: '/multiple/{path*}', | ||
handler: { | ||
directory: { | ||
path: function () { | ||
return ['./', '../']; | ||
}, | ||
listing: true | ||
} | ||
} | ||
}); | ||
server.inject('/multiple/package.json', function (res) { | ||
@@ -580,3 +592,8 @@ | ||
var orig = Fs.readdir; | ||
Fs.readdir = function (path, callback) { Fs.readdir = orig; callback(new Error('Simulated Directory Error')); }; | ||
Fs.readdir = function (path, callback) { | ||
Fs.readdir = orig; | ||
return callback(new Error('Simulated Directory Error')); | ||
}; | ||
server.inject('/directorylist/', function (res) { | ||
@@ -640,2 +657,3 @@ | ||
var plugin = function (server, options, next) { | ||
server.path(__dirname); | ||
@@ -663,2 +681,3 @@ server.route({ method: 'GET', path: '/test/{path*}', config: { handler: { directory: { path: Path.join('.', 'directory'), index: false, listing: false } } } }); | ||
var plugin = function (server, options, next) { | ||
server.route({ method: 'GET', path: '/test/{path*}', config: { handler: { directory: { path: Path.join('.', 'test', 'directory'), index: false, listing: false } } } }); | ||
@@ -665,0 +684,0 @@ return next(); |
@@ -292,3 +292,3 @@ // Load modules | ||
return '../' + request.params.file; | ||
return '../lib/' + request.params.file; | ||
}; | ||
@@ -301,3 +301,3 @@ | ||
expect(res.payload).to.contain('./lib'); | ||
expect(res.payload).to.contain('// Load modules'); | ||
expect(res.headers['content-type']).to.equal('application/javascript; charset=utf-8'); | ||
@@ -345,3 +345,3 @@ expect(res.headers['content-length']).to.exist(); | ||
var server = provisionServer(); | ||
server.route({ method: 'GET', path: '/', handler: { file: Path.join(__dirname, '..', 'Makefile') } }); | ||
server.route({ method: 'GET', path: '/', handler: { file: Path.join(__dirname, '..', 'LICENSE') } }); | ||
@@ -360,3 +360,3 @@ server.inject('/', function (res) { | ||
reply.file('../Makefile').type('application/example'); | ||
reply.file('../LICENSE').type('application/example'); | ||
}; | ||
@@ -618,4 +618,11 @@ | ||
var server = provisionServer(); | ||
server.route({ method: 'GET', path: '/', handler: function (request, reply) { reply('ok').header('last-modified', 'some crap'); } }); | ||
server.route({ | ||
method: 'GET', | ||
path: '/', | ||
handler: function (request, reply) { | ||
reply('ok').header('last-modified', 'some crap'); | ||
} | ||
}); | ||
server.inject({ url: '/', headers: { 'if-modified-since': 'Fri, 28 Mar 2014 22:52:39 GMT' } }, function (res2) { | ||
@@ -665,4 +672,11 @@ | ||
var server = provisionServer(); | ||
server.route({ method: 'GET', path: '/file', handler: function (request, reply) { reply(Fs.createReadStream(Path.join(__dirname, '..', 'package.json'))).header('etag', 'abc'); } }); | ||
server.route({ | ||
method: 'GET', | ||
path: '/file', | ||
handler: function (request, reply) { | ||
reply(Fs.createReadStream(Path.join(__dirname, '..', 'package.json'))).header('etag', 'abc'); | ||
} | ||
}); | ||
server.inject('/file', function (res1) { | ||
@@ -874,2 +888,3 @@ | ||
server.inject('/', function (res) { | ||
Fs.unlinkSync(filename); | ||
@@ -893,3 +908,7 @@ | ||
request.response._marshall = function () { throw new Error('not called'); }; | ||
request.response._marshall = function () { | ||
throw new Error('not called'); | ||
}; | ||
return reply.continue(); | ||
@@ -914,2 +933,3 @@ }); | ||
server.ext('onPreResponse', function (request, reply) { | ||
reply(Boom.internal('crapping out')); | ||
@@ -994,3 +1014,3 @@ }); | ||
Fs.open = orig; | ||
return Fs.open(path, mode, function(err, fd) { | ||
return Fs.open(path, mode, function (err, fd) { | ||
@@ -1002,3 +1022,3 @@ if (err) { | ||
} else if (err.code === 'EPERM') { | ||
err.code = 'EPERM'; | ||
err.code = 'EACCES'; | ||
err.errno = -13; | ||
@@ -1005,0 +1025,0 @@ } |
Sorry, the diff of this file is not supported yet
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
366043
1821
25
+ Addedlru-cache@2.6.5(transitive)
- Removedlru-cache@2.5.2(transitive)
Updatedlru-cache@2.6.x