Compare commits

...

1 Commits

Author SHA1 Message Date
Quentin McGaw
42caa64743 fix(httpproxy): redirect from http to https 2023-05-29 09:40:37 +00:00

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
} }