Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/tools/mcp/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ func (t *oauthTransport) handleManagedOAuthFlow(ctx context.Context, authServer,
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
return err
_, _ = io.ReadAll(resp.Body)
return errors.New("failed to fetch protected resource metadata")
}
var resourceMetadata protectedResourceMetadata
if resp.StatusCode == http.StatusOK {
Expand Down Expand Up @@ -390,7 +391,8 @@ func (t *oauthTransport) handleUnmanagedOAuthFlow(ctx context.Context, authServe
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
return err
_, _ = io.ReadAll(resp.Body)
return errors.New("failed to fetch protected resource metadata")
}
var resourceMetadata protectedResourceMetadata
if resp.StatusCode == http.StatusOK {
Expand Down
Loading