From 42caa647435e102000fb6840e21c155445749935 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 29 May 2023 09:40:37 +0000 Subject: [PATCH] fix(httpproxy): redirect from http to https --- internal/httpproxy/handler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/httpproxy/handler.go b/internal/httpproxy/handler.go index 39f2cc7a8..4921a8cd2 100644 --- a/internal/httpproxy/handler.go +++ b/internal/httpproxy/handler.go @@ -2,7 +2,6 @@ package httpproxy import ( "context" - "fmt" "net/http" "sync" "time" @@ -66,5 +65,8 @@ var hopHeaders = [...]string{ //nolint:gochecknoglobals // Do not follow redirect, but directly return the redirect response. 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 }