[Pkg-javascript-commits] [node-static] 52/151: Fix: International characters (like umlauts) in URLs where not decoded

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:17:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository node-static.

commit 6ec674e1ced1a6a5d4ec9298698a9e9fad45c4e2
Author: cimnine <mail at cimnine.ch>
Date:   Thu Aug 11 21:20:23 2011 +0200

    Fix: International characters (like umlauts) in URLs where not decoded
    
    The filename requested was "Summerfäscht.jpg", what encodes to
    "Summerf 30X1.D78P-10654scht.jpg". The reconversion was not made in
    node-static. This lead to a 404 despite the files availability.
---
 lib/node-static.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/node-static.js b/lib/node-static.js
index c1fa5e7..aadea8f 100644
--- a/lib/node-static.js
+++ b/lib/node-static.js
@@ -158,8 +158,8 @@ this.Server.prototype.resolve = function (pathname) {
 this.Server.prototype.serve = function (req, res, callback) {
     var that = this,
         promise = new(events.EventEmitter);
-
-    var pathname = url.parse(req.url).pathname;
+    
+    var pathname = decodeURI(url.parse(req.url).pathname);
 
     var finish = function (status, headers) {
         that.finish(status, headers, req, res, promise, callback);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-static.git



More information about the Pkg-javascript-commits mailing list