add a http3.Server.EnableDatagram option

This commit is contained in:
Marten Seemann
2020-12-21 11:16:41 +07:00
parent aaf1d381d3
commit 0b0cb7c06f
2 changed files with 29 additions and 4 deletions

View File

@@ -775,4 +775,15 @@ var _ = Describe("Server", func() {
fullpem, privkey := testdata.GetCertificatePaths()
Expect(ListenAndServeQUIC("", fullpem, privkey, nil)).To(MatchError(testErr))
})
It("supports H3_DATAGRAM", func() {
s.EnableDatagrams = true
var receivedConf *quic.Config
quicListenAddr = func(addr string, _ *tls.Config, config *quic.Config) (quic.EarlyListener, error) {
receivedConf = config
return nil, errors.New("listen err")
}
Expect(s.ListenAndServe()).To(HaveOccurred())
Expect(receivedConf.EnableDatagrams).To(BeTrue())
})
})