Socket
Socket
Sign inDemoInstall

serve-static

Package Overview
Dependencies
Maintainers
6
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve-static - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

HISTORY.md

31

index.js

@@ -27,5 +27,6 @@ /*!

exports = module.exports = function(root, options){
// root required
if (!root) throw new TypeError('root path required');
exports = module.exports = function serveStatic(root, options) {
if (!root) {
throw new TypeError('root path required')
}

@@ -36,6 +37,6 @@ // copy options object

// resolve root to absolute
root = resolve(root);
root = resolve(root)
// default redirect
var redirect = false !== options.redirect;
var redirect = options.redirect !== false

@@ -51,11 +52,13 @@ // headers listener

// setup options for send
options.maxage = options.maxage || options.maxAge || 0;
options.root = root;
options.maxage = options.maxage || options.maxAge || 0
options.root = root
return function staticMiddleware(req, res, next) {
if ('GET' != req.method && 'HEAD' != req.method) return next();
return function serveStatic(req, res, next) {
if (req.method !== 'GET' && req.method !== 'HEAD') {
return next()
}
var opts = merge({}, options)
var originalUrl = parseurl.original(req);
var path = parseurl(req).pathname;
var originalUrl = parseurl.original(req)
var path = parseurl(req).pathname

@@ -99,4 +102,4 @@ if (path === '/' && originalUrl.pathname[originalUrl.pathname.length - 1] !== '/') {

stream.pipe(res)
};
};
}
}

@@ -110,2 +113,2 @@ /**

exports.mime = send.mime;
exports.mime = send.mime
{
"name": "serve-static",
"description": "Serve static files",
"version": "1.5.3",
"version": "1.5.4",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -11,7 +11,7 @@ "license": "MIT",

"parseurl": "~1.3.0",
"send": "0.8.3",
"send": "0.8.5",
"utils-merge": "1.0.0"
},
"devDependencies": {
"istanbul": "0.3.0",
"istanbul": "0.3.2",
"mocha": "~1.21.0",

@@ -21,2 +21,7 @@ "should": "~4.0.0",

},
"files": [
"LICENSE",
"HISTORY.md",
"index.js"
],
"engines": {

@@ -23,0 +28,0 @@ "node": ">= 0.8.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