Skip to content

Commit 9b9504e

Browse files
committed
Disable redirects in HTTP resolver
1 parent 744cf52 commit 9b9504e

File tree

1 file changed

+5
-0
lines changed
  • internal/api/handlers/v0/auth

1 file changed

+5
-0
lines changed

internal/api/handlers/v0/auth/http.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func NewDefaultHTTPKeyFetcher() *DefaultHTTPKeyFetcher {
4343
return &DefaultHTTPKeyFetcher{
4444
client: &http.Client{
4545
Timeout: 10 * time.Second,
46+
// Disable redirects for security purposes:
47+
// Prevents people doing weird things like sending us to internal endpoints at different paths
48+
CheckRedirect: func(req *http.Request, via []*http.Request) error {
49+
return http.ErrUseLastResponse
50+
},
4651
},
4752
}
4853
}

0 commit comments

Comments
 (0)