From e14dd2fe5b79d1ca1624d4914feb47d87814ef75 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 22 Mar 2024 10:24:37 +1000 Subject: [PATCH] http3: improve documentation for Server.SetQuicHeaders (#4376) --- http3/server.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/http3/server.go b/http3/server.go index cc8dd027..aeb956d1 100644 --- a/http3/server.go +++ b/http3/server.go @@ -715,13 +715,13 @@ func (s *Server) CloseGracefully(timeout time.Duration) error { var ErrNoAltSvcPort = errors.New("no port can be announced, specify it explicitly using Server.Port or Server.Addr") // SetQuicHeaders can be used to set the proper headers that announce that this server supports HTTP/3. -// The values set by default advertise all of the ports the server is listening on, but can be -// changed to a specific port by setting Server.Port before launching the serverr. +// The values set by default advertise all the ports the server is listening on, but can be +// changed to a specific port by setting Server.Port before launching the server. // If no listener's Addr().String() returns an address with a valid port, Server.Addr will be used // to extract the port, if specified. // For example, a server launched using ListenAndServe on an address with port 443 would set: // -// Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 +// Alt-Svc: h3=":443"; ma=2592000 func (s *Server) SetQuicHeaders(hdr http.Header) error { s.mutex.RLock() defer s.mutex.RUnlock() @@ -729,8 +729,7 @@ func (s *Server) SetQuicHeaders(hdr http.Header) error { if s.altSvcHeader == "" { return ErrNoAltSvcPort } - // use the map directly to avoid constant canonicalization - // since the key is already canonicalized + // use the map directly to avoid constant canonicalization since the key is already canonicalized hdr["Alt-Svc"] = append(hdr["Alt-Svc"], s.altSvcHeader) return nil }