Add Http2Origin option to force HTTP/2 origin connections

If `http2Origin` is set, it will set `ForceAttemptHTTP2` in the transport config of the `OriginService`.
This commit is contained in:
Niklas Rehfeld
2022-06-01 12:51:59 +12:00
parent 4b6437cc60
commit 7d4afd4ae0
5 changed files with 22 additions and 1 deletions

View File

@@ -291,6 +291,7 @@ func newHTTPTransport(service OriginService, cfg OriginRequestConfig, log *zerol
TLSHandshakeTimeout: cfg.TLSTimeout.Duration,
ExpectContinueTimeout: 1 * time.Second,
TLSClientConfig: &tls.Config{RootCAs: originCertPool, InsecureSkipVerify: cfg.NoTLSVerify},
ForceAttemptHTTP2: cfg.Http2Origin,
}
if _, isHelloWorld := service.(*helloWorld); !isHelloWorld && cfg.OriginServerName != "" {
httpTransport.TLSClientConfig.ServerName = cfg.OriginServerName