Permalink
Browse files

Only listen for GET requests in the static middleware

  • Loading branch information...
1 parent f407a4c commit 9e3ff8222727b36690b7083e46a77458bc73c0e2 @creationix committed Jul 30, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 static.js
View
1 static.js
@@ -26,6 +26,7 @@ if (!process.EventEmitter.prototype.hasOwnProperty('once')) {
// Super simple static file server
module.exports = function setup(mount, root, index) {
return function (req, res, next) {
+ if (req.method !== 'GET') return next();
if (!req.uri) { req.uri = Url.parse(req.url); }
var path = unescape(req.uri.pathname).replace(/\.\.+/g, '.');
if (!path || path.substr(0, mount.length) !== mount) {

0 comments on commit 9e3ff82

Please sign in to comment.