diff --git a/api/next/75500.txt b/api/next/75500.txt new file mode 100644 index 00000000000..7cf5bcf654d --- /dev/null +++ b/api/next/75500.txt @@ -0,0 +1 @@ +pkg net/http, type Server struct, DisableClientPriority bool #75500 diff --git a/doc/next/6-stdlib/99-minor/net/http/75500.md b/doc/next/6-stdlib/99-minor/net/http/75500.md new file mode 100644 index 00000000000..a4031250dc0 --- /dev/null +++ b/doc/next/6-stdlib/99-minor/net/http/75500.md @@ -0,0 +1,4 @@ +HTTP/2 server now accepts client priority signals, as defined in RFC 9218, +allowing it to prioritize serving HTTP/2 streams with higher priority. If the +old behavior is preferred, where streams are served in a round-robin manner +regardless of priority, [Server.DisableClientPriority] can be set to `true`. diff --git a/src/net/http/server.go b/src/net/http/server.go index 406d2a84075..a388777d3a5 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -3074,6 +3074,17 @@ type Server struct { // the default is HTTP/1 only. Protocols *Protocols + // DisableClientPriority specifies whether client-specified priority, as + // specified in RFC 9218, should be respected or not. + // + // This field only takes effect if using HTTP/2, and if no custom write + // scheduler is defined for the HTTP/2 server. Otherwise, this field is a + // no-op. + // + // If set to true, requests will be served in a round-robin manner, without + // prioritization. + DisableClientPriority bool + inShutdown atomic.Bool // true when server is in shutdown disableKeepAlives atomic.Bool