1
0
mirror of https://github.com/golang/go synced 2024-09-29 10:24:34 -06:00
The Go programming language
Go to file
Kévin Dunglas 770e0e584a net/http: allow sending 1xx responses
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: 06d749d345
GitHub-Pull-Request: golang/go#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>
2022-05-17 16:09:37 +00:00
.github .github: remove duplicate security link 2022-01-07 17:55:09 +00:00
api time: add Time.ZoneBounds 2022-05-17 03:26:28 +00:00
doc spec: fix prose about promoted methods of embedded fields 2022-05-12 22:29:02 +00:00
lib/time lib/time, time/tzdata: update to 2021e 2021-11-11 05:16:39 +00:00
misc runtime: add address sanitizer support for riscv64 2022-05-16 06:55:54 +00:00
src net/http: allow sending 1xx responses 2022-05-17 16:09:37 +00:00
test cmd/compile: tighten the condition for inlining shape/non-shape function 2022-05-17 00:58:22 +00:00
.gitattributes
.gitignore
AUTHORS A+C: add Jinzhu Zhang 2022-05-08 17:28:26 +00:00
codereview.cfg
CONTRIBUTING.md
CONTRIBUTORS A+C: add Jinzhu Zhang 2022-05-08 17:28:26 +00:00
LICENSE
PATENTS
README.md README.md: update wiki link 2022-04-26 16:21:18 +00:00
SECURITY.md SECURITY.md: replace golang.org with go.dev 2022-04-26 19:59:47 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.