Solve issue when dynamic upstreams use wrong protocol upstream.

This commit is contained in:
Kiss Károly 2022-06-14 15:42:33 +02:00
parent 2a97902c21
commit 3c9806ccb6

View File

@ -298,7 +298,7 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
func (h *HTTPTransport) SetScheme(req *http.Request) {
if req.URL.Scheme == "" {
req.URL.Scheme = "http"
if h.TLS != nil {
if h.TLS != nil && req.URL.Port() != "80" {
req.URL.Scheme = "https"
}
}