Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42caa64743 |
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user