Skip to content

Commit

Permalink
allow head requests which have no body to avoid error from connect/ex…
Browse files Browse the repository at this point in the history
…press of 'This type of response MUST NOT have a body. Ignoring data passed to end()'
  • Loading branch information
Dane Springmeyer committed Dec 1, 2011
1 parent 1ebe4d1 commit 3361b4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/middleware.js
Expand Up @@ -41,7 +41,7 @@ exports['sanitizeHost'] = function sanitizeHost(app) {


exports['validateCSRFToken'] = function validateCSRFToken() { exports['validateCSRFToken'] = function validateCSRFToken() {
return function(req, res, next) { return function(req, res, next) {
if (req.method === 'GET') { if (req.method === 'GET' || req.method === 'HEAD') {
next(); next();
} else if (req.body && req.cookies['bones.token'] && req.body['bones.token'] === req.cookies['bones.token']) { } else if (req.body && req.cookies['bones.token'] && req.body['bones.token'] === req.cookies['bones.token']) {
delete req.body['bones.token']; delete req.body['bones.token'];
Expand Down

0 comments on commit 3361b4e

Please sign in to comment.