{"issue":{"state":"open","created_at":"2011-11-22T12:50:34Z","updated_at":"2011-11-22T12:50:34Z","comments":0,"user":{"gravatar_id":"3d43d9038ab645ecb2e3a1df2951d30a","id":275871,"url":"https://api.github.com/users/bnoordhuis","avatar_url":"https://secure.gravatar.com/avatar/3d43d9038ab645ecb2e3a1df2951d30a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bnoordhuis"},"body":"Reported by Dave Irvine (davman in #node.js).\r\n\r\nTest case:\r\n\r\n```javascript\r\nvar assert = require('assert');\r\nvar http = require('http');\r\n\r\nvar gotError = false;\r\n\r\nprocess.on('exit', function() {\r\n  assert.equal(gotError, true);\r\n});\r\n\r\nvar server = http.createServer(function (req, res) {\r\n  res.writeHead(200, {'Content-Type': 'text/plain'});\r\n  res.end(['moo']); // send array, triggers assert\r\n});\r\n\r\nserver.listen(8080, function() {\r\n  var req = http.get({host:'127.0.0.1', port:8080}, function(res) {\r\n    // do nothing\r\n  }); \r\n\r\n  req.on('error', function(e) {\r\n    // expect parse error\r\n    assert.equal(e.message, 'Parse Error');\r\n    gotError = true;\r\n    server.close();\r\n  }); \r\n});\r\n```\r\n\r\nPasses with master, triggers an assert in v0.6.\r\n\r\n```\r\nnode: ../src/stream_wrap.cc:289: static v8::Handle<v8::Value> node::StreamWrap::Write(const v8::Arguments&): Assertion `Buffer::HasInstance(args[0])' failed.\r\nAborted\r\n```\r\n\r\nSide question: should `res.end(['foo'])` raise a TypeError or do something with the array?","assignee":null,"id":2317525,"labels":[{"name":"http","color":"e10c02","url":"https://api.github.com/repos/joyent/node/labels/http"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":2162,"title":"http: res.end(array) triggers assert() in v0.6","html_url":"https://github.com/joyent/node/issues/2162","closed_at":null,"url":"https://api.github.com/repos/joyent/node/issues/2162","milestone":{"state":"open","created_at":"2011-11-20T13:32:41Z","closed_issues":0,"due_on":"2011-11-25T08:00:00Z","creator":{"gravatar_id":"3d43d9038ab645ecb2e3a1df2951d30a","id":275871,"url":"https://api.github.com/users/bnoordhuis","avatar_url":"https://secure.gravatar.com/avatar/3d43d9038ab645ecb2e3a1df2951d30a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bnoordhuis"},"number":11,"description":"","title":"v0.6.3","url":"https://api.github.com/repos/joyent/node/milestones/11","open_issues":3}},"action":"opened"}