Socket
Socket
Sign inDemoInstall

serve-static

Package Overview
Dependencies
Maintainers
4
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.0.3 to 1.0.4

History.md

26

index.js

@@ -13,2 +13,4 @@ /*!

var parseurl = require('parseurl');
var resolve = require('path').resolve;
var send = require('send');

@@ -52,2 +54,5 @@ var url = require('url');

// resolve root to absolute
root = resolve(root);
// default redirect

@@ -59,3 +64,3 @@ var redirect = false !== options.redirect;

var originalUrl = url.parse(req.originalUrl || req.url);
var path = parse(req).pathname;
var path = parseurl(req).pathname;

@@ -116,20 +121,1 @@ if (path == '/' && originalUrl.pathname[originalUrl.pathname.length - 1] != '/') {

};
/**
* Parse the `req` url.
*
* @param {ServerRequest} req
* @return {Object}
* @api private
*/
function parse(req) {
var parsed = url.parse(req.url);
if (parsed.auth && !parsed.protocol && ~parsed.href.indexOf('//')) {
// This parses pathnames, and a strange pathname like //r@e should work
parsed = url.parse(req.url.replace(/@/g, '%40'));
}
return parsed;
};
{
"name": "serve-static",
"description": "Serve static files",
"version": "1.0.3",
"version": "1.0.4",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -15,2 +15,3 @@ "license": "MIT",

"dependencies": {
"parseurl": "1.0.1",
"send": "0.2.0"

@@ -20,5 +21,5 @@ },

"connect": "~2.14.1",
"mocha": "~1.17.1",
"should": "~3.1.3",
"supertest": "~0.9.0"
"mocha": "~1.18.2",
"should": "~3.3.0",
"supertest": "~0.10.0"
},

@@ -25,0 +26,0 @@ "engines": {

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