Skip to content

Commit

Permalink
fix(httpproxy): redirect from http to https
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed May 29, 2023
1 parent 6d48f9c commit 42caa64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/httpproxy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package httpproxy

import (
"context"
"fmt"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -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
}

0 comments on commit 42caa64

Please sign in to comment.