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.4.0 to 0.4.1

test/malformed.js

12

lib/ecstatic.js

@@ -33,5 +33,11 @@ #! /usr/bin/env node

// Figure out the path for the file from the given url
var parsed = url.parse(req.url),
pathname = decodeURI(parsed.pathname),
file = path.normalize(
var parsed = url.parse(req.url);
try {
var pathname = decodeURI(parsed.pathname);
}
catch (err) {
return status[400](res, next, { error: err });
}
var file = path.normalize(
path.join(root,

@@ -38,0 +44,0 @@ path.relative(

@@ -52,1 +52,7 @@ // not modified

};
// bad request
exports['400'] = function (res, next, opts) {
res.statusCode = 400;
res.end(opts && opts.error ? String(opts.error) : 'Malformed request.');
};

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

"description": "A simple static file server middleware that works with both Express and Flatiron",
"version": "0.4.0",
"version": "0.4.1",
"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