{"action":"opened","issue":{"number":595,"created_at":"2011-10-25T17:15:21Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"if i send a head request on socket.io server that is created by port number, i have the node warning \"This type of response MUST NOT have a body. Ignoring data passed to end()\"\r\n\r\nThe context is :\r\n\r\n$ npm install socket.io\r\n$ vi app.js\r\n\r\n```javascript\r\nvar io = require('socket.io').listen(8001);\r\nio.configure('development', function () {\r\n  io.set('transports', ['websocket', 'xhr-polling']);\r\n  io.enable('log');\r\n});\r\n```\r\n\r\n$ node app.js\r\ninfo  - socket.io started\r\n\r\n$ curl http://localhost:8001\r\nWelcome to socket.io. __==> everything is ok__\r\n\r\n$ curl --head http://localhost:8001\r\n__==> curl response is ok but i have in console a node warning \"This type of response MUST NOT have a body. Ignoring data passed to end()\"__\r\n\r\nYou can fix it with this code in __lib/socket.io.js__: \r\n\r\n```javascript\r\n     // default response\r\n     server.on('request', function (req, res) {\r\n       res.writeHead(200);\r\n-      res.end('Welcome to socket.io.');\r\n+      res.end((req.method === 'HEAD') ? null : 'Welcome to socket.io.');\r\n     });\r\n```\r\n","comments":0,"title":"HEAD Request - node warning","updated_at":"2011-10-25T17:15:21Z","url":"https://api.github.com/repos/LearnBoost/socket.io/issues/595","id":2047328,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"f540a3437db55d73cf62bacf0781e22b","avatar_url":"https://secure.gravatar.com/avatar/f540a3437db55d73cf62bacf0781e22b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/hugdubois","id":159294,"login":"hugdubois"},"html_url":"https://github.com/LearnBoost/socket.io/issues/595","labels":[],"state":"open"},"legacy":{"number":595,"action":"opened","issue":2047328}}