fix(httpproxy): redirect from http to https

This commit is contained in:
Quentin McGaw
2023-05-29 09:39:48 +00:00
parent eca182a32f
commit bfe5e4380f

View File

@@ -2,7 +2,6 @@ package httpproxy
import ( import (
"context" "context"
"fmt"
"net/http" "net/http"
"sync" "sync"
"time" "time"
@@ -66,5 +65,8 @@ var hopHeaders = [...]string{ //nolint:gochecknoglobals
// Do not follow redirect, but directly return the redirect response. // Do not follow redirect, but directly return the redirect response.
func returnRedirect(*http.Request, []*http.Request) error { func returnRedirect(*http.Request, []*http.Request) error {
return fmt.Errorf("%w", http.ErrUseLastResponse) // WARNING: do not wrap this error!
// The standard library code checking against it does not use
// Go 1.13 `errors.Is` but `==`, so we cannot wrap it.
return http.ErrUseLastResponse
} }