Skip to content

Commit b37a7b9

Browse files
committed
Escaping
1 parent 67342cd commit b37a7b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ModelContextProtocol.AspNetCore/Auth/McpAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected override Task HandleChallengeAsync(AuthenticationProperties properties
130130

131131
// Set the WWW-Authenticate header with the resource_metadata
132132
string headerValue = $"Bearer realm=\"{Scheme.Name}\"";
133-
headerValue += $", resource_metadata=\"{rawPrmDocumentUri}\"";
133+
headerValue += $", resource_metadata=\"{Uri.EscapeDataString(rawPrmDocumentUri)}\"";
134134

135135
Response.Headers["WWW-Authenticate"] = headerValue;
136136

0 commit comments

Comments
 (0)