Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inert

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inert - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

lib/directory.js

@@ -232,3 +232,3 @@ // Load modules

return /^\./.test(Path.basename(path));
return /(^|[\\\/])\.([^\\\/]|[\\\/]?$)/.test(path); // Starts with a '.' or contains '/.' or '\.', and not followed by a '/' or '\' or end
};

@@ -235,0 +235,0 @@

{
"name": "inert",
"description": "Static file and directory handlers for hapi.js",
"version": "1.1.0",
"version": "1.1.1",
"repository": "git://github.com/hapijs/inert",

@@ -6,0 +6,0 @@ "main": "index",

@@ -277,3 +277,3 @@ // Load modules

it('returns the index when found in hidden folder', function (done) {
it('returns the index when served from a hidden folder', function (done) {

@@ -297,3 +297,3 @@ var server = provisionServer({ files: { relativeTo: __dirname } });

it('returns listing when found in hidden folder', function (done) {
it('returns listing when served from a hidden folder', function (done) {

@@ -378,2 +378,31 @@ var server = provisionServer({ files: { relativeTo: __dirname } });

it('returns a 404 response when requesting a file in a hidden directory when showHidden is disabled', function (done) {
var server = provisionServer({ files: { relativeTo: __dirname } });
server.route({ method: 'GET', path: '/noshowhidden/{path*}', handler: { directoryTest: { path: './directory', listing: true } } });
server.inject('/noshowhidden/.dot/index.html', function (res) {
expect(res.statusCode).to.equal(404);
server.inject('/noshowhidden/.dot/', function (res) {
expect(res.statusCode).to.equal(404);
done();
});
});
});
it('returns a 404 response when requesting a hidden directory listing when showHidden is disabled', function (done) {
var server = provisionServer({ files: { relativeTo: __dirname } });
server.route({ method: 'GET', path: '/noshowhidden/{path*}', handler: { directoryTest: { path: './directory', listing: true, index: false } } });
server.inject('/noshowhidden/.dot/', function (res) {
expect(res.statusCode).to.equal(404);
done();
});
});
it('returns a file when requesting a hidden file when showHidden is enabled', function (done) {

@@ -391,2 +420,21 @@

it('returns a a file when requesting a file in a hidden directory when showHidden is enabled', function (done) {
var server = provisionServer({ files: { relativeTo: __dirname } });
server.route({ method: 'GET', path: '/noshowhidden/{path*}', handler: { directoryTest: { path: './directory', showHidden: true, listing: true } } });
server.inject('/noshowhidden/.dot/index.html', function (res) {
expect(res.statusCode).to.equal(200);
expect(res.payload).to.contain('test');
server.inject('/noshowhidden/.dot/', function (res) {
expect(res.statusCode).to.equal(200);
expect(res.payload).to.contain('test');
done();
});
});
});
it('redirects to the same path with / appended if asking for a directory', function (done) {

@@ -393,0 +441,0 @@

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