From afbe993b4c6720cfb8f21ad15c8da7cf00174433 Mon Sep 17 00:00:00 2001 From: Aaron Riekenberg Date: Sun, 19 Sep 2021 15:51:09 -0500 Subject: [PATCH] Add test setting http3.Server.Port. --- http3/server_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http3/server_test.go b/http3/server_test.go index 04896ad3..02e9c416 100644 --- a/http3/server_test.go +++ b/http3/server_test.go @@ -591,6 +591,14 @@ var _ = Describe("Server", func() { Expect(s.SetQuicHeaders(hdr)).To(Succeed()) Expect(hdr).To(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3-29=":443"; ma=2592000`}})) }) + + It("uses s.Port if set to a non-zero value", func() { + s.Server.Addr = ":443" + s.Port = 8443 + hdr := http.Header{} + Expect(s.SetQuicHeaders(hdr)).To(Succeed()) + Expect(hdr).To(Equal(http.Header{"Alt-Svc": {`h3-29=":8443"; ma=2592000`}})) + }) }) It("errors when ListenAndServe is called with s.Server nil", func() {