-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/net/http2: allow sending 1xx responses #96
Conversation
This PR (HEAD: 2f6bd1b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
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.
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.
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.
2f6bd1b
to
501d06d
Compare
This PR (HEAD: 501d06d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
Message from Marten Seemann: Patch Set 2: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Brad Fitzpatrick: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Kévin Dunglas: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Kévin Dunglas: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Brad Fitzpatrick: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Kévin Dunglas: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Kévin Dunglas: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
501d06d
to
a0692c4
Compare
This PR (HEAD: a0692c4) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
a0692c4
to
f8a62e7
Compare
This PR (HEAD: f8a62e7) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: 782fc6a) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: 1f811a1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
Message from Damien Neil: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Gopher Robot: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Gopher Robot: Patch Set 6: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Damien Neil: Patch Set 6: Code-Review+1 (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
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. 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 #26089. Fixes #36734. Updates #26088. Updates #42597.
1f811a1
to
f2f4deb
Compare
This PR (HEAD: f2f4deb) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
Message from Kévin Dunglas: Patch Set 7: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Damien Neil: Patch Set 7: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Damien Neil: Patch Set 7: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Gopher Robot: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Gopher Robot: Patch Set 7: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Dmitri Shuralyov: Patch Set 7: Code-Review+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
f2f4deb
to
f73d0ff
Compare
This PR (HEAD: f73d0ff) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
Message from Brad Fitzpatrick: Patch Set 9: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
Message from Kévin Dunglas: Patch Set 9: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
This PR (HEAD: eee95b5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/net/+/291029 to see it. Tip: You can toggle comments from me using the |
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. If the status code is in the 1xx range, 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. Change-Id: Iadb7be92844a3588ef4ce044f887ef5c1792f431 GitHub-Last-Rev: eee95b5 GitHub-Pull-Request: #96 Reviewed-on: https://go-review.googlesource.com/c/net/+/291029 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Message from Damien Neil: Patch Set 10: Run-TryBot+1 Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/291029. |
This PR is being closed because golang.org/cl/291029 has been merged. |
golang/net#134 and golang/net#96 have been merged. I updated h2_bundle.go and unskipped TestEarlyHintsRequest_h2.
golang/net#134 and golang/net#96 have been merged. This patch updates h2_bundle.go and enables TestEarlyHintsRequest_h2.
golang/net#134 and golang/net#96 have been merged. This patch updates h2_bundle.go and enables TestEarlyHintsRequest_h2. Change-Id: Ia53fee6b3c4892a7cde10e7b62cbe7b64fa9f155 GitHub-Last-Rev: ea521b0 GitHub-Pull-Request: #52947 Reviewed-on: https://go-review.googlesource.com/c/go/+/406914 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
golang/net#134 and golang/net#96 have been merged. This patch updates h2_bundle.go and enables TestEarlyHintsRequest_h2. Change-Id: Ia53fee6b3c4892a7cde10e7b62cbe7b64fa9f155 GitHub-Last-Rev: ea521b02ae1e873f9b8be6a2a3e81699d8eb5584 GitHub-Pull-Request: golang/go#52947 Reviewed-on: https://go-review.googlesource.com/c/go/+/406914 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
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. If the status code is in the 1xx range, 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. Change-Id: Iadb7be92844a3588ef4ce044f887ef5c1792f431 GitHub-Last-Rev: eee95b58b3b259781fc1052ed6143a0aa9284e04 GitHub-Pull-Request: golang/net#96 Reviewed-on: https://go-review.googlesource.com/c/net/+/291029 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
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. If the status code is in the 1xx range, 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. Change-Id: Iadb7be92844a3588ef4ce044f887ef5c1792f431 GitHub-Last-Rev: eee95b58b3b259781fc1052ed6143a0aa9284e04 GitHub-Pull-Request: golang/net#96 Reviewed-on: https://go-review.googlesource.com/c/net/+/291029 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
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.
If the status code is in the 1xx range, 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.