Skip to content

Commit

Permalink
net/http: add ResponseController http2 request without body read dead…
Browse files Browse the repository at this point in the history
…line test

Requires CL 464936

For golang#58237
  • Loading branch information
AlexanderYastrebov committed Jul 21, 2023
1 parent e713d6f commit 3e3a9aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/net/http/responsecontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,18 @@ func testResponseControllerEnableFullDuplex(t *testing.T, mode testMode) {
}
pw.Close()
}

func TestIssue58237(t *testing.T) {
cst := newClientServerTest(t, http2Mode, HandlerFunc(func(w ResponseWriter, req *Request) {
ctl := NewResponseController(w)
if err := ctl.SetReadDeadline(time.Now().Add(1 * time.Millisecond)); err != nil {
t.Errorf("ctl.SetReadDeadline() = %v, want nil", err)
}
time.Sleep(10 * time.Millisecond)
}))
res, err := cst.c.Get(cst.ts.URL)
if err != nil {
t.Fatal(err)
}
defer res.Body.Close()
}

0 comments on commit 3e3a9aa

Please sign in to comment.