Skip to content

fix: preserve configured reqwest client#917

Merged
DaleSeo merged 1 commit into
mainfrom
fix/oauth-reqwest-stop-client
Jun 22, 2026
Merged

fix: preserve configured reqwest client#917
DaleSeo merged 1 commit into
mainfrom
fix/oauth-reqwest-stop-client

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jun 22, 2026

Copy link
Copy Markdown
Member

Motivation and Context

Following up on PR #908, this fixes a regression from the OAuth HTTP client adapter change where AuthorizationManager::with_client no longer preserved the caller-provided reqwest configuration for token operations. Existing users of with_client(reqwest::Client) expect their proxy, TLS, connector, timeout, and default-header settings to apply across OAuth requests, including authorization-code exchange.

The regression happened because the adapter kept the configured reqwest client for redirect-following requests, but built a separate default client for OAuthHttpRedirectPolicy::Stop. That preserved the new no-redirect intent for token requests, but it also dropped any caller-provided reqwest configuration on those requests.

This fix preserves the legacy with_client contract by using the configured reqwest client for both redirect policies on that path, while leaving the newer OAuthHttpClient path available for callers that need stricter redirect handling.

How Has This Been Tested?

Added regression tests

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@DaleSeo DaleSeo self-assigned this Jun 22, 2026
@github-actions github-actions Bot added T-core Core library changes T-transport Transport layer changes labels Jun 22, 2026
@DaleSeo DaleSeo force-pushed the fix/oauth-reqwest-stop-client branch from 2c5e93a to c6ce6f5 Compare June 22, 2026 20:53
@DaleSeo DaleSeo force-pushed the fix/oauth-reqwest-stop-client branch from c6ce6f5 to 6b27456 Compare June 22, 2026 20:57
@DaleSeo DaleSeo marked this pull request as ready for review June 22, 2026 21:02
@DaleSeo DaleSeo requested a review from a team as a code owner June 22, 2026 21:02
@DaleSeo DaleSeo merged commit 6d020c9 into main Jun 22, 2026
18 checks passed
@DaleSeo DaleSeo deleted the fix/oauth-reqwest-stop-client branch June 22, 2026 21:34
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants