fix(nodeserver): properly escape all, not just first char

This commit is contained in:
Igor Minar 2011-10-27 08:44:14 -07:00
parent bf729d550b
commit 445680f601

View file

@ -85,7 +85,7 @@ StaticServlet.MimeMap = {
StaticServlet.prototype.handleRequest = function(req, res) { StaticServlet.prototype.handleRequest = function(req, res) {
var self = this; var self = this;
var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/, function(match, hex){ var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/g, function(match, hex){
return String.fromCharCode(parseInt(hex, 16)); return String.fromCharCode(parseInt(hex, 16));
}); });
var parts = path.split('/'); var parts = path.split('/');