{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/22624","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/22624/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/22624/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/22624/events","html_url":"https://github.com/nodejs/node/issues/22624","id":356017770,"node_id":"MDU6SXNzdWUzNTYwMTc3NzA=","number":22624,"title":"Make http.OutgoingMessage._writeRaw public","user":{"login":"evert","id":178960,"node_id":"MDQ6VXNlcjE3ODk2MA==","avatar_url":"https://avatars3.githubusercontent.com/u/178960?v=4","gravatar_id":"","url":"https://api.github.com/users/evert","html_url":"https://github.com/evert","followers_url":"https://api.github.com/users/evert/followers","following_url":"https://api.github.com/users/evert/following{/other_user}","gists_url":"https://api.github.com/users/evert/gists{/gist_id}","starred_url":"https://api.github.com/users/evert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evert/subscriptions","organizations_url":"https://api.github.com/users/evert/orgs","repos_url":"https://api.github.com/users/evert/repos","events_url":"https://api.github.com/users/evert/events{/privacy}","received_events_url":"https://api.github.com/users/evert/received_events","type":"User","site_admin":false},"labels":[{"id":207445406,"node_id":"MDU6TGFiZWwyMDc0NDU0MDY=","url":"https://api.github.com/repos/nodejs/node/labels/feature%20request","name":"feature request","color":"0D7BDE","default":false},{"id":155267422,"node_id":"MDU6TGFiZWwxNTUyNjc0MjI=","url":"https://api.github.com/repos/nodejs/node/labels/http","name":"http","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-08-31T15:05:33Z","updated_at":"2018-11-14T04:44:24Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for suggesting an idea to make Node.js better.\r\n\r\nPlease fill in as much of the template below as you're able.\r\n-->\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\n\r\nI am trying to return HTTP informational statuses to the client. In particular 100, 102, 103 but I would also like to open the door to being able to support future informational status codes.\r\n\r\nBoth 100 and 102 have a dedicated method:\r\n\r\n* `HttpServerResponse.sendContinue` for 100 and\r\n* `HttpServerResponse.sendProcessing` for 102.\r\n\r\nIt would be possible to add another function like it (sendEarlyHints), but it seems a little silly given that these informational statuses more or less follow the same structure.  \r\n\r\nThe http2 library solves this with the `additionalHeaders` function. To illustrate, this is how I send *any* informational status using http2:\r\n\r\n```javascript\r\nconst otherHeaders = { };\r\nconst status = 103;\r\n\r\nstream.additionalHeaders({\r\n   ':status': status,\r\n  ...otherHeaders\r\n});\r\n```\r\n\r\nThis is how I do it for the HTTP1 api:\r\n\r\n```javascript\r\nconst otherHeaders = { };\r\nconst status = 103;\r\nconst rawHeaders = [];\r\n  for (const headerName of Object.keys(outHeaders)) {\r\n    const headerValue = outHeaders[headerName];\r\n    if (Array.isArray(headerValue)) {\r\n      for (const headerVal of headerValue) {\r\n        rawHeaders.push(`${headerName}: ${headerVal}\\r\\n`);\r\n      }\r\n    } else {\r\n      rawHeaders.push(`${headerName}: ${headerValue}\\r\\n`);\r\n    }\r\n}\r\n\r\nconst writeRaw = promisify(res._writeRaw.bind(this.inner));\r\nconst message = `HTTP/1.1 ${status} ${http.STATUS_CODES[status]}\\r\\n${rawHeaders.join('')}\\r\\n`;\r\nawait writeRaw(message, 'ascii');\r\n```\r\n\r\nThe problem here is that I'm using `res._writeRaw`, an undocumented 'private' feature. I would like to not have to rely on this, but as far as I can tell, it's the only 'sane' way.\r\n\r\n**Describe the solution you'd like**\r\n\r\nMake `_writeRaw` a documented, supported feature OR supply a reasonable API for returning any 1xx status header. \r\n\r\n**Describe alternatives you've considered**\r\n\r\nAs far as I know there's no real alternative."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/438535718","html_url":"https://github.com/nodejs/node/issues/22624#issuecomment-438535718","issue_url":"https://api.github.com/repos/nodejs/node/issues/22624","id":438535718,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODUzNTcxOA==","user":{"login":"Trott","id":718899,"node_id":"MDQ6VXNlcjcxODg5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/718899?v=4","gravatar_id":"","url":"https://api.github.com/users/Trott","html_url":"https://github.com/Trott","followers_url":"https://api.github.com/users/Trott/followers","following_url":"https://api.github.com/users/Trott/following{/other_user}","gists_url":"https://api.github.com/users/Trott/gists{/gist_id}","starred_url":"https://api.github.com/users/Trott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trott/subscriptions","organizations_url":"https://api.github.com/users/Trott/orgs","repos_url":"https://api.github.com/users/Trott/repos","events_url":"https://api.github.com/users/Trott/events{/privacy}","received_events_url":"https://api.github.com/users/Trott/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T04:44:24Z","updated_at":"2018-11-14T04:44:24Z","author_association":"MEMBER","body":"Is anyone working on this? Should it get a `stalled` label and moved to https://github.com/nodejs/node/projects/13? /cc @refack "}}
{"actor":{"display_login":"Trott"}}