Merge branch v2.11 into v3.0

This commit is contained in:
kevinpollet 2024-07-02 14:32:51 +02:00
commit 8d016f5e16
No known key found for this signature in database
GPG key ID: 0C9A5DDD1B292453
12 changed files with 180 additions and 39 deletions

View file

@ -9,6 +9,7 @@ import (
"net/http"
"sync"
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/http3"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/static"
@ -51,12 +52,15 @@ func newHTTP3Server(ctx context.Context, configuration *static.EntryPoint, https
Port: configuration.HTTP3.AdvertisedPort,
Handler: httpsServer.Server.(*http.Server).Handler,
TLSConfig: &tls.Config{GetConfigForClient: h3.getGetConfigForClient},
QUICConfig: &quic.Config{
Allow0RTT: false,
},
}
previousHandler := httpsServer.Server.(*http.Server).Handler
httpsServer.Server.(*http.Server).Handler = http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
if err := h3.Server.SetQuicHeaders(rw.Header()); err != nil {
if err := h3.Server.SetQUICHeaders(rw.Header()); err != nil {
log.Ctx(ctx).Error().Err(err).Msg("Failed to set HTTP3 headers")
}