{"action":"created","issue":{"url":"https://api.github.com/repos/koajs/koa/issues/612","labels_url":"https://api.github.com/repos/koajs/koa/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/koajs/koa/issues/612/comments","events_url":"https://api.github.com/repos/koajs/koa/issues/612/events","html_url":"https://github.com/koajs/koa/pull/612","id":119871756,"number":612,"title":"fix: should not destroy streams","user":{"login":"dead-horse","id":985607,"avatar_url":"https://avatars.githubusercontent.com/u/985607?v=3","gravatar_id":"","url":"https://api.github.com/users/dead-horse","html_url":"https://github.com/dead-horse","followers_url":"https://api.github.com/users/dead-horse/followers","following_url":"https://api.github.com/users/dead-horse/following{/other_user}","gists_url":"https://api.github.com/users/dead-horse/gists{/gist_id}","starred_url":"https://api.github.com/users/dead-horse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dead-horse/subscriptions","organizations_url":"https://api.github.com/users/dead-horse/orgs","repos_url":"https://api.github.com/users/dead-horse/repos","events_url":"https://api.github.com/users/dead-horse/events{/privacy}","received_events_url":"https://api.github.com/users/dead-horse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/koajs/koa/labels/1.x","name":"1.x","color":"0052cc"},{"url":"https://api.github.com/repos/koajs/koa/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"dead-horse","id":985607,"avatar_url":"https://avatars.githubusercontent.com/u/985607?v=3","gravatar_id":"","url":"https://api.github.com/users/dead-horse","html_url":"https://github.com/dead-horse","followers_url":"https://api.github.com/users/dead-horse/followers","following_url":"https://api.github.com/users/dead-horse/following{/other_user}","gists_url":"https://api.github.com/users/dead-horse/gists{/gist_id}","starred_url":"https://api.github.com/users/dead-horse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dead-horse/subscriptions","organizations_url":"https://api.github.com/users/dead-horse/orgs","repos_url":"https://api.github.com/users/dead-horse/repos","events_url":"https://api.github.com/users/dead-horse/events{/privacy}","received_events_url":"https://api.github.com/users/dead-horse/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2015-12-02T05:43:48Z","updated_at":"2015-12-06T10:32:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/koajs/koa/pulls/612","html_url":"https://github.com/koajs/koa/pull/612","diff_url":"https://github.com/koajs/koa/pull/612.diff","patch_url":"https://github.com/koajs/koa/pull/612.patch"},"body":"use black-hole-stream to make sure stream's data has been read.\r\n\r\nsince user may set `this.body` to a http `IncomingMessage`, if we destroy this stream, it will destroy the http socket that make `keep-alive` failed, and may affect other http requests reusing this socket.\r\nI think maybe we shouldn't destroy streams, only need to insure streams' data will be read and don't leak."},"comment":{"url":"https://api.github.com/repos/koajs/koa/issues/comments/162299081","html_url":"https://github.com/koajs/koa/pull/612#issuecomment-162299081","issue_url":"https://api.github.com/repos/koajs/koa/issues/612","id":162299081,"user":{"login":"juliangruber","id":10247,"avatar_url":"https://avatars.githubusercontent.com/u/10247?v=3","gravatar_id":"","url":"https://api.github.com/users/juliangruber","html_url":"https://github.com/juliangruber","followers_url":"https://api.github.com/users/juliangruber/followers","following_url":"https://api.github.com/users/juliangruber/following{/other_user}","gists_url":"https://api.github.com/users/juliangruber/gists{/gist_id}","starred_url":"https://api.github.com/users/juliangruber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliangruber/subscriptions","organizations_url":"https://api.github.com/users/juliangruber/orgs","repos_url":"https://api.github.com/users/juliangruber/repos","events_url":"https://api.github.com/users/juliangruber/events{/privacy}","received_events_url":"https://api.github.com/users/juliangruber/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T10:32:57Z","updated_at":"2015-12-06T10:32:57Z","body":"your patch fails if the body stream is endless, like for example:\r\n\r\n```js\r\nthis.body = fs.createReadStream('/dev/urandom');\r\n```\r\n\r\nor more real-worldy\r\n\r\n```js\r\nthis.body = serverSentEvents(createUpdateStream());\r\n```\r\n\r\nin the cases above it's required to destroy the stream."}}