Skip to content

Commit 45c4b30

Browse files
committed
Proper array caching
1 parent ca0cdf3 commit 45c4b30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ModelContextProtocol/Authentication/AuthorizationDelegatingHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class AuthorizationDelegatingHandler : DelegatingHandler
1111
{
1212
private readonly IMcpAuthorizationProvider _authorizationProvider;
1313
private string _currentScheme;
14+
private static readonly char[] SchemeSplitDelimiters = { ' ', ',' };
1415

1516
/// <summary>
1617
/// Initializes a new instance of the <see cref="AuthorizationDelegatingHandler"/> class.
@@ -123,7 +124,7 @@ private static List<string> ExtractServerSupportedSchemes(HttpResponseMessage re
123124
{
124125
// Extract the scheme from the WWW-Authenticate header
125126
// Format is typically: "Scheme param1=value1, param2=value2"
126-
string scheme = authHeader.Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)[0];
127+
string scheme = authHeader.Split(SchemeSplitDelimiters, StringSplitOptions.RemoveEmptyEntries)[0];
127128
if (!string.IsNullOrEmpty(scheme))
128129
{
129130
serverSchemes.Add(scheme);

0 commit comments

Comments
 (0)