Skip to content

Commit ec926c3

Browse files
committed
WIP whitespace
1 parent 1720664 commit ec926c3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/ModelContextProtocol.Core/Authentication/AuthorizationDelegatingHandler.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public AuthorizationDelegatingHandler(IMcpCredentialProvider credentialProvider)
2020
Throw.IfNull(credentialProvider);
2121

2222
_credentialProvider = credentialProvider;
23-
23+
2424
// Select first supported scheme as the default
2525
_currentScheme = _credentialProvider.SupportedSchemes.FirstOrDefault() ??
2626
throw new ArgumentException("Authorization provider must support at least one authentication scheme.", nameof(credentialProvider));
@@ -50,8 +50,8 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
5050
/// Handles a 401 Unauthorized response by attempting to authenticate and retry the request.
5151
/// </summary>
5252
private async Task<HttpResponseMessage> HandleUnauthorizedResponseAsync(
53-
HttpRequestMessage originalRequest,
54-
HttpResponseMessage response,
53+
HttpRequestMessage originalRequest,
54+
HttpResponseMessage response,
5555
CancellationToken cancellationToken)
5656
{
5757
// Gather the schemes the server wants us to use from WWW-Authenticate headers
@@ -62,8 +62,8 @@ private async Task<HttpResponseMessage> HandleUnauthorizedResponseAsync(
6262

6363
// First try to find a direct match with the current scheme if it's still valid
6464
string schemeUsed = originalRequest.Headers.Authorization?.Scheme ?? _currentScheme ?? string.Empty;
65-
if (!string.IsNullOrEmpty(schemeUsed) &&
66-
serverSchemes.Contains(schemeUsed) &&
65+
if (!string.IsNullOrEmpty(schemeUsed) &&
66+
serverSchemes.Contains(schemeUsed) &&
6767
_credentialProvider.SupportedSchemes.Contains(schemeUsed))
6868
{
6969
bestSchemeMatch = schemeUsed;
@@ -157,7 +157,7 @@ private async Task<HttpResponseMessage> HandleUnauthorizedResponseAsync(
157157
// Send the retry request
158158
return await base.SendAsync(retryRequest, cancellationToken).ConfigureAwait(false);
159159
}
160-
160+
161161
return response; // Return the original response if we couldn't handle it
162162
}
163163

@@ -167,7 +167,7 @@ private async Task<HttpResponseMessage> HandleUnauthorizedResponseAsync(
167167
private static HashSet<string> ExtractServerSupportedSchemes(HttpResponseMessage response)
168168
{
169169
var serverSchemes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
170-
170+
171171
if (response.Headers.Contains("WWW-Authenticate"))
172172
{
173173
foreach (var authHeader in response.Headers.GetValues("WWW-Authenticate"))
@@ -178,7 +178,7 @@ private static HashSet<string> ExtractServerSupportedSchemes(HttpResponseMessage
178178
serverSchemes.Add(scheme);
179179
}
180180
}
181-
181+
182182
return serverSchemes;
183183
}
184184

src/ModelContextProtocol.Core/Authentication/GenericOAuthProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ private Uri BuildAuthorizationUrl(
456456
};
457457
return uriBuilder.Uri;
458458
}
459+
459460
private async Task<string?> GetAuthorizationCodeAsync(Uri authorizationUrl, CancellationToken cancellationToken)
460461
{
461462
return await _authorizationUrlHandler(authorizationUrl, _redirectUri, cancellationToken);

0 commit comments

Comments
 (0)