Commit Graph

6 Commits

Author SHA1 Message Date
Kévin Dunglas
3b916f2e80 allow sending 1xx responses (#3047)
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) and HTTP/2 (golang/net#96).

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.
2021-03-05 10:03:31 +08:00
Marten Seemann
35939b25a9 allow access to the underlying quic.Stream from a http.ResponseWriter 2021-01-17 14:35:21 +08:00
Marten Seemann
8752576f26 run gofumpt, enable the gofumpt linter 2020-10-26 09:33:35 +07:00
Marten Seemann
683230372e use a buffered writer for the http3 response writer 2020-04-02 15:15:29 +07:00
Marten Seemann
93b1ff8e2c don't fake-implement the http.CloseNotifier interface 2019-09-05 11:47:46 +07:00
Marten Seemann
4f6d0e651a implement HTTP/3 2019-04-11 09:06:10 +09:00