envoy: fix sni/hostname mismatched routing for http2 connection coalescing (#703)

This commit is contained in:
Caleb Doxsey 2020-05-14 15:35:48 -06:00 committed by Travis Groth
parent 65bb1501fd
commit 1bee3b0df9
5 changed files with 79 additions and 10 deletions

View file

@ -24,15 +24,20 @@ func New(workingDir string) *Cluster {
}
}
// NewHTTPClient creates a new *http.Client, with a cookie jar, and a LocalRoundTripper
// which routes traffic to the nginx ingress controller.
// NewHTTPClient calls NewHTTPClientWithTransport with the default cluster transport.
func (cluster *Cluster) NewHTTPClient() *http.Client {
return cluster.NewHTTPClientWithTransport(cluster.Transport)
}
// NewHTTPClientWithTransport creates a new *http.Client, with a cookie jar, and a LocalRoundTripper
// which routes traffic to the nginx ingress controller.
func (cluster *Cluster) NewHTTPClientWithTransport(transport http.RoundTripper) *http.Client {
jar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
if err != nil {
panic(err)
}
return &http.Client{
Transport: &loggingRoundTripper{cluster.Transport},
Transport: &loggingRoundTripper{transport},
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},