Skip to content

Commit

Permalink
maybe 4
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Dec 11, 2024
1 parent 131d29f commit 28a9a7d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/netext/httpext/error_codes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,16 @@ func TestHTTP2GoAwayError(t *testing.T) {
t.Parallel()

tb := getHTTP2ServerWithCustomConnContext(t)
tb.Mux.HandleFunc("/tsr", func(_ http.ResponseWriter, req *http.Request) {
tb.Mux.HandleFunc("/tsr", func(rw http.ResponseWriter, req *http.Request) {
conn := req.Context().Value(connKey).(*tls.Conn)
f := http2.NewFramer(conn, conn)
require.NoError(t, f.WriteGoAway(4, http2.ErrCodeInadequateSecurity, []byte("whatever")))
// require.NoError(t, conn.CloseWrite())
flusher, ok := rw.(http.Flusher)
if !ok {
panic("expected http.ResponseWriter to be http.Flusher")
}
flusher.Flush()
require.NoError(t, conn.CloseWrite())
})
client := http.Client{
Timeout: time.Second * 5,
Expand Down

0 comments on commit 28a9a7d

Please sign in to comment.