Skip to content

Conversation

@findleyr
Copy link
Contributor

RoundTrippers may read and close the body, so be careful to clone before roundtripping during client oauth, as the request may be issued multiple times.

Fixes #590

@findleyr findleyr requested a review from jba October 22, 2025 16:44
@findleyr findleyr force-pushed the oauth branch 6 times, most recently from a1fbc37 to d412e55 Compare October 22, 2025 17:39
@findleyr
Copy link
Contributor Author

Staticcheck failures are being addressed in #599.

Copy link
Contributor

@jba jba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this was a bit more complicated than I had thought.

RoundTrippers may read and close the body, so be careful to clone before
roundtripping during client oauth, as the request may be issued multiple
times.

Fixes modelcontextprotocol#590
Copy link
Contributor Author

@findleyr findleyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I had to rebase and squash in order to pick up the CI fixes.

client := &http.Client{Transport: transport}

resp, err := client.Post(authServer.URL, "application/json", &basicReader{strings.NewReader("{}")})
// resp, err := client.Post(authServer.URL, "application/json", strings.NewReader("{}"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cruft.

jba
jba previously approved these changes Oct 22, 2025
@jba jba merged commit 1a907bc into modelcontextprotocol:main Oct 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace body for second call and OAuth flow

2 participants