Title: http: add writeInformation to send arbitrary 1xx status codes by pimterry · Pull Request #63155 · nodejs/node · GitHub
Open Graph Title: http: add writeInformation to send arbitrary 1xx status codes by pimterry · Pull Request #63155 · nodejs/node
X Title: http: add writeInformation to send arbitrary 1xx status codes by pimterry · Pull Request #63155 · nodejs/node
Description: This provides a generic HTTP/1 API for 1xx responses, equivalent to our existing HTTP/2 additionalHeaders API. This supports any 1xx status code, except 101, which I've intentionally excluded - since it changes the protocol entirely, there's no possible way to unilaterally send that without breaking things later in our current API, so you just have to use 'upgrade' in that case. This fixes various past requests like: #22624 #27921 And acts as a nice workaround to solve: #7588 (All 3 closed as stale, not fixed) I'm also hoping it'll discourage usage of the private res._writeRaw method as a workaround for the existing limitations. We even did this in our own tests, see test/parallel/test-http-information-headers.js here. This is useful to support custom 1xx values (perfectly valid AFAICT, if unusual), proxies (who want to pass through data in a standard way, without having to separately handle each case individually as today) and to give us trivial general support for future standardized 1xx values, without needing a whole separate PR to add a new per-status API every time. The existing methods are refactored to use the generic method under the hood, and HTTP/2 compat uses additionalHeaders. There's one annoying inconsistency here: the H1 methods throw if we've already sent a final status code, while the H2 methods just no-op. I've kept that as-is and matched this in the new method to avoid a breaking change, but it would probably be best to align on throwing in both cases in a separate major bump.
Open Graph Description: This provides a generic HTTP/1 API for 1xx responses, equivalent to our existing HTTP/2 additionalHeaders API. This supports any 1xx status code, except 101, which I've intentionally excluded -...
X Description: This provides a generic HTTP/1 API for 1xx responses, equivalent to our existing HTTP/2 additionalHeaders API. This supports any 1xx status code, except 101, which I've intentionally exclud...
Opengraph URL: https://github.com/nodejs/node/pull/63155
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9761e40e-7f76-4cf0-f698-5da816ba3e69 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9AAA:228A12:2253BFB:309459D:6A4CE024 |
| html-safe-nonce | 34df61e1b8a081674332e133ffd4e34e6eaf7c0b4a2b56f2bd63864babf67087 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUFBOjIyOEExMjoyMjUzQkZCOjMwOTQ1OUQ6NkE0Q0UwMjQiLCJ2aXNpdG9yX2lkIjoiNjg2MTQ1MDYzNzg3MzA0NTU0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ebb03b6a40d3ca7f783805cfa921df3b34cd1586ee0e0d0af5dfb7d1f9fc017 |
| hovercard-subject-tag | pull_request:3638157788 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/63155/files |
| twitter:image | https://avatars.githubusercontent.com/u/1526883?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1526883?s=400&v=4 |
| og:image:alt | This provides a generic HTTP/1 API for 1xx responses, equivalent to our existing HTTP/2 additionalHeaders API. This supports any 1xx status code, except 101, which I've intentionally excluded -... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3eeb74f55ccd8a31bdaec6839577c592bbf7844c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width