x/net/http2: allow sending 1xx responses #87
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, it's not possible to send informational responses such as 103 Early Hints or 102 Processing.
This patch allows calling
WriteHeader()
multiple times in order to send informational responses before the final one.It follows the patch for HTTP/1: golang/go#42597
In conformance with RFC 8297, if the status code is 103 the current content of the header map is also sent. Its content is not removed after the call to
WriteHeader()
because the headers must also be included in the final response.The Chrome and Fastly teams are starting a large-scale experiment to measure the real-life impact of the 103 status code.
Using Early Hints is proposed as a (partial) alternative to Server Push, which are going to be removed from Chrome: https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/21anpFhxAQAJ
Being able to send this status code from servers implemented using Go would help to see if implementing it in browsers is worth it.
Fixes golang/go#26089.
Fixes golang/go#36734.
Updates golang/go#26088.
Updates golang/go#42597.