serve-static
Advanced tools
Comparing version 1.0.3 to 1.0.4
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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6565
7
2
101
+ Addedparseurl@1.0.1
+ Addedparseurl@1.0.1(transitive)