Socket
Socket
Sign inDemoInstall

ecstatic

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecstatic - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

28

lib/ecstatic.js

@@ -24,3 +24,3 @@ var path = require('path'),

pathname = decodeURI(parsed.pathname),
file = path.normalize(path.join(root, parsed.pathname));
file = path.normalize(path.join(root, pathname));

@@ -42,17 +42,13 @@ // Set common headers.

// retry for ./404.html, if that's not there then return 404
// TODO: Make this pluggable/configurable.
var handler = (typeof next === 'function' && !autoIndex)
? next
: function () {
showDir(file, pathname, stat, cache)(req, res);
};
middleware({
url: '/404.html',
statusCode: 404 // Override the response
}, res, function (req, res, next) {
if (req.statusCode == 404) {
// This means we're already trying ./404.html
status[404](res, next);
});
}
else {
// Try for ./404.html
middleware({
url: '/404.html',
statusCode: 404 // Override the response status code
}, res, next);
}
}

@@ -69,3 +65,3 @@ else if (err) {

: function () {
showDir(file, pathname, stat, cache)(req, res);
showDir(root, pathname, stat, cache)(req, res);
};

@@ -72,0 +68,0 @@

@@ -5,3 +5,3 @@ {

"description": "A simple static file server middleware that works with both Express and Flatiron",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/jesusabdullah/node-ecstatic",

@@ -8,0 +8,0 @@ "repository": {

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