Skip to content

Commit

Permalink
unescape urls
Browse files Browse the repository at this point in the history
Change-Id: I1247b2fc8183ddd1a1d8a89d7c5833fc928f0534
  • Loading branch information
Tim Caswell committed Feb 12, 2011
1 parent 1fe551c commit 48212b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion listing.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var ENOENT = process.ENOENT || require('constants').ENOENT;
// Super simple static file server // Super simple static file server
module.exports = function setup(mount, root) { module.exports = function setup(mount, root) {
return function (req, res, next) { return function (req, res, next) {
var path = Url.parse(req.url).pathname.replace(/\.\.+/g, '.'); var path = unescape(Url.parse(req.url).pathname).replace(/\.\.+/g, '.');
if (!path || path.substr(0, mount.length) !== mount) { if (!path || path.substr(0, mount.length) !== mount) {
return next(); return next();
} }
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "creationix", "name": "creationix",
"description": "Creationix is a meta package for my personal packages", "description": "Creationix is a meta package for my personal packages",
"tags": ["stack", "creationix", "meta", "sandbox"], "tags": ["stack", "creationix", "meta", "sandbox"],
"version": "0.0.6", "version": "0.0.9",
"author": "Tim Caswell <tim@creationix.com>", "author": "Tim Caswell <tim@creationix.com>",
"repository": { "repository": {
"type": "git", "type": "git",
Expand All @@ -13,7 +13,8 @@
"auth": "auth.js", "auth": "auth.js",
"listing": "listing.js", "listing": "listing.js",
"mount": "mount.js", "mount": "mount.js",
"log": "log.js" "log": "log.js",
"controllers": "controllers.js"
}, },
"dependencies": { "dependencies": {
"stack": ">=0.0.3", "stack": ">=0.0.3",
Expand Down
2 changes: 1 addition & 1 deletion static.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!process.EventEmitter.prototype.hasOwnProperty('once')) {
// Super simple static file server // Super simple static file server
module.exports = function setup(mount, root, index) { module.exports = function setup(mount, root, index) {
return function (req, res, next) { return function (req, res, next) {
var path = Url.parse(req.url).pathname.replace(/\.\.+/g, '.'); var path = unescape(Url.parse(req.url).pathname).replace(/\.\.+/g, '.');
if (!path || path.substr(0, mount.length) !== mount) { if (!path || path.substr(0, mount.length) !== mount) {
return next(); return next();
} }
Expand Down

0 comments on commit 48212b1

Please sign in to comment.