diff --git a/http3/roundtrip.go b/http3/roundtrip.go index bed421030..d86b0bb22 100644 --- a/http3/roundtrip.go +++ b/http3/roundtrip.go @@ -202,6 +202,7 @@ func (r *RoundTripper) getClient(hostname string, onlyCached bool) (rtc *roundTr MaxHeaderBytes: r.MaxResponseHeaderBytes, StreamHijacker: r.StreamHijacker, UniStreamHijacker: r.UniStreamHijacker, + AdditionalSettings: r.AdditionalSettings, }, r.QuicConfig, dial, diff --git a/http3/roundtrip_test.go b/http3/roundtrip_test.go index 30672384a..8b59a8bb7 100644 --- a/http3/roundtrip_test.go +++ b/http3/roundtrip_test.go @@ -71,6 +71,21 @@ var _ = Describe("RoundTripper", func() { Expect(err).To(MatchError(testErr)) }) + It("creates new clients with additional settings", func() { + testErr := errors.New("test err") + req, err := http.NewRequest("GET", "https://quic.clemente.io/foobar.html", nil) + Expect(err).ToNot(HaveOccurred()) + rt.AdditionalSettings = map[uint64]uint64{1337: 42} + rt.newClient = func(_ string, _ *tls.Config, opts *roundTripperOpts, conf *quic.Config, _ dialFunc) (roundTripCloser, error) { + cl := NewMockRoundTripCloser(mockCtrl) + cl.EXPECT().RoundTripOpt(gomock.Any(), gomock.Any()).Return(nil, testErr) + Expect(opts.AdditionalSettings).To(HaveKeyWithValue(uint64(1337), uint64(42))) + return cl, nil + } + _, err = rt.RoundTrip(req) + Expect(err).To(MatchError(testErr)) + }) + It("uses the quic.Config, if provided", func() { config := &quic.Config{HandshakeIdleTimeout: time.Millisecond} var receivedConfig *quic.Config