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

net/http: Server/Handler/ResponseWriter doesn't allowing sending arbitrary 1xx responses #26089

Closed
bradfitz opened this issue Jun 27, 2018 · 5 comments
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Thinking
Milestone

Comments

@bradfitz
Copy link
Contributor

As part of #17739 (properly handling 1xx responses per the HTTP specs), we need to be able to forward 1xx responses in ReverseProxy (#26088)

To forward such responses, we need a way for for an http.Handler in a Server to use the ResponseWriter (or something) to send a 1xx response.

@bradfitz bradfitz added Thinking NeedsFix The path to resolution is known, but the work has not been done. FeatureRequest labels Jun 27, 2018
@bradfitz bradfitz added this to the Unplanned milestone Jun 27, 2018
@bradfitz
Copy link
Contributor Author

(Notably, to send any number of 1xx responses and then a final non-1xx response)

Maybe we just allow multiple ResponseWriter.WriteHeader calls and say that 1xx writes clear the header for future calls to Header?

dunglas added a commit to dunglas/go that referenced this issue Nov 13, 2020
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 golang#26089.
Fixes golang#36734.
Updates golang#26088.
@gopherbot
Copy link

Change https://golang.org/cl/269997 mentions this issue: net/http: allow sending 1xx responses

@gopherbot
Copy link

Change https://golang.org/cl/270157 mentions this issue: http2: allow sending 1xx responses

dunglas added a commit to dunglas/go that referenced this issue 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
@gopherbot
Copy link

Change https://golang.org/cl/291029 mentions this issue: http2: allow sending 1xx responses

dunglas added a commit to dunglas/go that referenced this issue 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue May 25, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Jul 16, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Dec 21, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Jan 4, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Mar 25, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Mar 28, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Apr 8, 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.

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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue Apr 29, 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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue 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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue May 17, 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#26089.
Fixes golang#36734.
Updates golang#26088.
dunglas added a commit to dunglas/go that referenced this issue May 17, 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#26089.
Fixes golang#36734.
Updates golang#26088.
gopherbot pushed a commit that referenced this issue May 17, 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 #26089
Fixes #36734
Updates #26088

Change-Id: Ib7023c1892c35e8915d4305dd7f6373dbd00a19d
GitHub-Last-Rev: 06d749d
GitHub-Pull-Request: #42597
Reviewed-on: https://go-review.googlesource.com/c/go/+/269997
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
@dmitshur dmitshur removed this from the Unplanned milestone May 17, 2022
@dmitshur dmitshur added this to the Go1.19 milestone May 17, 2022
dteh pushed a commit to dteh/fhttp that referenced this issue 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>
dunglas added a commit to dunglas/go that referenced this issue Oct 11, 2022
The existing implementation doesn't allow tracing
1xx responses.
This patch allows using net/http/httptrace to inspect
1XX responses.

Updates golang#26089.
dunglas added a commit to dunglas/go that referenced this issue Oct 11, 2022
The existing implementation doesn't allow tracing
1xx responses.
This patch allow using net/http/httptrace to inspect
1XX responses.

Updates golang#26089.
@gopherbot
Copy link

Change https://go.dev/cl/442215 mentions this issue: net/http/httptest: add support for 1XX responses

WeiminShang added a commit to WeiminShang/net that referenced this issue 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>
dunglas added a commit to dunglas/go that referenced this issue Nov 23, 2022
The existing implementation doesn't allow tracing
1xx responses.
This patch allows using net/http/httptrace to inspect
1XX responses.

Updates golang#26089.
@golang golang locked and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Thinking
Projects
None yet
3 participants