Permalink
Browse files

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.
  • Loading branch information...
1 parent 0978855 commit 6ec674e1ced1a6a5d4ec9298698a9e9fad45c4e2 @cimnine cimnine committed Aug 11, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-static.js
View
4 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);

0 comments on commit 6ec674e

Please sign in to comment.