Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

dunglas
Copy link
Contributor

@dunglas dunglas commented Feb 10, 2021

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.

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

dunglas added a commit to dunglas/quic-go that referenced this pull request Feb 17, 2021
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.
dunglas added a commit to dunglas/quic-go that referenced this pull request Feb 18, 2021
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.
marten-seemann pushed a commit to quic-go/quic-go that referenced this pull request Mar 5, 2021
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.
@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Marten Seemann:

Patch Set 2: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 2:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 2:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 6: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

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.
@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 7:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 7: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 7: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 7:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@dunglas dunglas force-pushed the feat/http-103-status-code branch from f2f4deb to f73d0ff Compare May 4, 2022 13:21
@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 9:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Kévin Dunglas:

Patch Set 9:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/291029.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

gopherbot pushed a commit that referenced this pull request May 13, 2022
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>
@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/291029 has been merged.

@gopherbot gopherbot closed this May 13, 2022
dunglas added a commit to dunglas/go that referenced this pull request May 17, 2022
golang/net#134 and golang/net#96 have been merged.
I updated h2_bundle.go and unskipped TestEarlyHintsRequest_h2.
dunglas added a commit to dunglas/go that referenced this pull request May 17, 2022
golang/net#134 and golang/net#96 have been merged.
This patch updates h2_bundle.go and enables TestEarlyHintsRequest_h2.
gopherbot pushed a commit to golang/go that referenced this pull request May 17, 2022
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>
dteh pushed a commit to dteh/fhttp that referenced this pull request Jun 10, 2022
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>
dteh pushed a commit to dteh/fhttp that referenced this pull request Jun 22, 2022
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>
WeiminShang added a commit to WeiminShang/net that referenced this pull request Nov 16, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants