Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http/httptrace: GotFirstResponseByte can fire twice for HTTP/2 after 100-continue response #15777
I just noticed that the httptrace.ClientTrace.GotFirstResponseByte hook can fire twice for HTTP/2 connections when the client sent an "Expect: 100-continue" request.
The standard library's net/http tests should check for exactly one occurrence of the substrings in TestTransportEventTrace*, and the http2 code should track whether it already called that hook.
I disappear for a month starting in a few hours. Maybe somebody can fix for 1.7. If not, low priority. Maybe it could even be documented instead for now.
Updates x/net/http2 to git rev 6bdd4be4 for CL 23526: http2: GotFirstResponseByte hook should only fire once Also updated the trace hooks test to verify that all trace hooks are called exactly once except ConnectStart/End, which may be called multiple times (due to happy-eyeballs). Fixes #15777 Change-Id: Iea5c64eb322b58be27f9ff863b3a6f90e996fa9b Reviewed-on: https://go-review.googlesource.com/23527 Reviewed-by: Andrew Gerrand <email@example.com>