[net] internal/http3: prevent Server handler from writing longer body than declared

0 views
Skip to first unread message

Nicholas Husin (Gerrit)

unread,
Feb 24, 2026, 7:19:05 PM (8 hours ago) Feb 24
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Nicholas Husin, Damien Neil, Go LUCI, golang-co...@googlegroups.com

Nicholas Husin submitted the change

Change information

Commit message:
internal/http3: prevent Server handler from writing longer body than declared

Like in HTTP/1 and HTTP/2, this CL changes the Server handler so that
Write will return an error and automatically trim the content being
written, when attempting to write a body content that is longer than
what has been declared in the "Content-Length" header.

For golang/go#70914
Change-Id: I638efb8ec96f926f86c389f3cac79f1b38a5b36b
Reviewed-by: Nicholas Husin <hu...@google.com>
Reviewed-by: Damien Neil <dn...@google.com>
Files:
  • M internal/http3/server.go
  • M internal/http3/server_test.go
Change size: M
Delta: 2 files changed, 97 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Nicholas Husin, +2 by Damien Neil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: net
Gerrit-Branch: master
Gerrit-Change-Id: I638efb8ec96f926f86c389f3cac79f1b38a5b36b
Gerrit-Change-Number: 748681
Gerrit-PatchSet: 3
Gerrit-Owner: Nicholas Husin <n...@golang.org>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Nicholas Husin <hu...@google.com>
Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages