Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ func (t *Transport) GetT1() *http.Transport {
return t.t1
}

// SetT1 sets the HTTP/1 Transport whose settings, such as
// ResponseHeaderTimeout and DisableKeepAlives, this transport uses.
// Unlike ConfigureTransports, it does not modify t1.
// It must be called before the transport is first used.
func (t *Transport) SetT1(t1 *http.Transport) {
t.t1 = t1
}

func (t *Transport) maxHeaderListSize() uint32 {
maxHeaderListSize, ok := t.Settings[SettingMaxHeaderListSize]

Expand Down
4 changes: 2 additions & 2 deletions http2/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2069,9 +2069,9 @@ func TestTransportResponseHeaderTimeout_Body(t *testing.T) {

func testTransportResponseHeaderTimeout(t *testing.T, body bool) {
ct := newClientTester(t)
ct.tr.t1 = &http.Transport{
ct.tr.SetT1(&http.Transport{
ResponseHeaderTimeout: 5 * time.Millisecond,
}
})
ct.client = func() error {
c := &http.Client{Transport: ct.tr}
var err error
Expand Down