diff --git a/doc/go1.20.html b/doc/go1.20.html index fa712696ff..730ef93330 100644 --- a/doc/go1.20.html +++ b/doc/go1.20.html @@ -332,7 +332,7 @@ func RequestHandler(w ResponseWriter, r *Request) {
+
The httputil.ReverseProxy
forwarding proxy includes a new Rewrite
hook function, superseding the
previous Director
hook.
@@ -358,7 +358,7 @@ func RequestHandler(w ResponseWriter, r *Request) {
also sets the Host
header of the outbound request.
+
The
ProxyRequest.SetXForwarded
method sets the X-Forwarded-For
, X-Forwarded-Host
,
@@ -380,6 +380,11 @@ proxyHandler := &httputil.ReverseProxy{
}
+
+ ReverseProxy
no longer adds a User-Agent
header
+ to forwarded requests when the incoming request does not have one.
+
@@ -396,14 +401,13 @@ proxyHandler := &httputil.ReverseProxy{
- When the GODEBUG=tarinsecurepath=0
environment variable
- is set, (*Reader).Next
will return the error
- ErrInsecurePath
when opening an archive which contains
- file names that are absolute, refer to a location outside the current
- directory, contain invalid characters, or (on Windows) are reserved
- names such as NUL
. Programs that perform their own
- name sanitization can ignore this error. This behavior will be made
- the default in a future version of Go.
+ When the GODEBUG=tarinsecurepath=0
environment variable is set,
+ Reader.Next
method
+ will now return the error ErrInsecurePath
+ for an entry with a file name that is an absolute path,
+ refers to a location outside the current directory, contains invalid
+ characters, or (on Windows) is a reserved name such as NUL
.
+ A future version of Go may disable insecure paths by default.
- When the GODEBUG=zipinsecurepath=0
environment variable
- is set, NewReader
will return the error
- ErrInsecurePath
when opening an archive which contains
- file names that are absolute, refer to a location outside the current
- irectory, contain invalid characters, or (on Windows) are reserved
- names such as NUL
. Programs that perform their own
- name sanitization can ignore this error. This behavior will be made
- the default in a future version of Go.
+ When the GODEBUG=zipinsecurepath=0
environment variable is set,
+ NewReader
will now return the error
+ ErrInsecurePath
+ when opening an archive which contains any file name that is an absolute path,
+ refers to a location outside the current directory, contains invalid
+ characters, or (on Windows) is a reserved names such as NUL
.
+ A future version of Go may disable insecure paths by default.
Reading from a directory file that contains file data will now return an error. @@ -557,7 +560,7 @@ proxyHandler := &httputil.ReverseProxy{
- The new Join
function returns an error wrapping a list of errors.
+ The new Join
function returns an error wrapping a list of errors.
- The Errorf
function supports multiple occurrances of
- the %w
format verb.
+ The Errorf
function supports multiple occurrences of
+ the %w
format verb, returning an error that unwraps to the list of all arguments to %w
.
TODO: https://go.dev/issue/51668: add FormatString(State) string @@ -646,7 +649,7 @@ proxyHandler := &httputil.ReverseProxy{
- The ParseMediaType
function now allows duplicate parameter names,
+ The ParseMediaType
function now allows duplicate parameter names,
so long as the values of the names are the same.
- Methods of the Reader
type now wrap errors
+ Methods of the Reader
type now wrap errors
returned by the underlying io.Reader
.
- The LookupCNAME
function now consistently returns the contents
+ The LookupCNAME
+ function now consistently returns the contents
of a CNAME
record when one exists. Previously on Unix systems and
when using the pure Go resolver, LookupCNAME
would return an error
if a CNAME
record referred to a name that with no A
,
@@ -675,15 +679,15 @@ proxyHandler := &httputil.ReverseProxy{
- Interface.Flags
now includes the new flag FlagRunning
,
+ Interface.Flags
now includes the new flag FlagRunning
,
indicating an operationally active interface. An interface which is administratively
configured but not active (for example, because the network cable is not connected)
will have FlagUp
set but not FlagRunning
.
- The new Dialer.ControlContext
field contains a callback function
- similar to the existing Dialer.Control
hook, that additionally
+ The new Dialer.ControlContext
field contains a callback function
+ similar to the existing Dialer.Control
hook, that additionally
accepts the dial context as a parameter.
Control
is ignored when ControlContext
is not nil.
- The new
- The new
- The
- The new
- The new
HTTP/2 stream errors returned by
@@ -752,28 +757,6 @@ proxyHandler := &httputil.ReverseProxy{
ResponseController
type provides access to extended per-request
- functionality not handled by the ResponseWriter
interface.
+ The new
ResponseController
type provides access to extended per-request
+ functionality not handled by the ResponseWriter
interface.
ResponseController.SetReadDeadline
and
- ResponseController.SetWriteDeadline
methods permit setting
+ The new ResponseController.SetReadDeadline
and
+ ResponseController.SetWriteDeadline
methods permit setting
per-request read and write deadlines.
ResponseWriter.WriteHeader
function now supports sending
+ The ResponseWriter.WriteHeader
function now supports sending
1xx
status codes.
Server.DisableGeneralOptionsHandler
configuration setting
+ The new Server.DisableGeneralOptionsHandler
configuration setting
allows disabling the default OPTIONS *
handler.
Transport.OnProxyConnectResponse
hook is called
+ The new Transport.OnProxyConnectResponse
hook is called
when a Transport
receives an HTTP response from a proxy
for a CONNECT
request.
net/http
functions may be converted
- to a "golang.org/x/net/http2".StreamError
using errors.As
.
+ to a golang.org/x/net/http2.StreamError
using
+ errors.As
.
- The new ReverseProxy
hook supersedes the existing Rewrite
hook.
-
- ReverseProxy
now adds
- X-Forwarded-Proto
and X-Forwarded-Host
headers
- to forwarded requests.
- These headers are added to all requests forwarded by a Director
hook,
- and to requests forwarded by a Rewrite
hook which calls the
- ProxyRequest.SetXForwarded
function.
-
- ReverseProxy
no longer adds a User-Agent
header
- to forwarded requests when the incoming request does not have one.
-
@@ -801,7 +784,9 @@ proxyHandler := &httputil.ReverseProxy{
- The new Cmd
fields Cancel
and WaitDelay
+ The new Cmd
fields
+ Cancel
and
+ WaitDelay
specify the behavior of the Cmd
when its associated
Context
is canceled or its process exits with I/O pipes still
held open by a child process.
@@ -815,7 +800,7 @@ proxyHandler := &httputil.ReverseProxy{
TODO: https://go.dev/cl/363814: path/filepath, io/fs: add SkipAll; modified api/next/47209.txt
- The new IsLocal
function reports whether a path is
+ The new IsLocal
function reports whether a path is
lexically local to a directory.
For example, if IsLocal(p)
is true
,
then Open(p)
will refer to a file that is lexically
@@ -899,9 +884,9 @@ proxyHandler := &httputil.ReverseProxy{
- The new methods Map.Swap
,
- Map.CompareAndSwap
, and
- Map.CompareAndDelete
+ The new Map
methods Swap
,
+ CompareAndSwap
, and
+ CompareAndDelete
allow existing map entries to be updated atomically.