diff --git a/app.js b/app.js index dcc3798..535dce7 100644 --- a/app.js +++ b/app.js @@ -5,6 +5,11 @@ var http = require("http"), port = process.argv[2] || 8888; http.createServer(function(request, response) { + if (path.normalize(decodeURI(request.url)) !== decodeURI(request.url)) { + response.statusCode = 403; + response.end(); + return; + } var uri = url.parse(request.url).pathname , filename = path.join(process.cwd(), uri);