Skip to content
Browse files

allow head requests which have no body to avoid error from connect/ex…

…press of 'This type of response MUST NOT have a body. Ignoring data passed to end()'
  • Loading branch information...
1 parent 1ebe4d1 commit 3361b4e7028811256787c17ccd33537278fbed83 @springmeyer springmeyer committed Nov 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 server/middleware.js
View
2 server/middleware.js
@@ -41,7 +41,7 @@ exports['sanitizeHost'] = function sanitizeHost(app) {
exports['validateCSRFToken'] = function validateCSRFToken() {
return function(req, res, next) {
- if (req.method === 'GET') {
+ if (req.method === 'GET' || req.method === 'HEAD') {
next();
} else if (req.body && req.cookies['bones.token'] && req.body['bones.token'] === req.cookies['bones.token']) {
delete req.body['bones.token'];

0 comments on commit 3361b4e

Please sign in to comment.
Something went wrong with that request. Please try again.