We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3a3715 commit e044475Copy full SHA for e044475
1 file changed
src/ModelContextProtocol.AspNetCore/Auth/McpAuthenticationHandler.cs
@@ -1,4 +1,5 @@
1
using Microsoft.AspNetCore.Authentication;
2
+using Microsoft.AspNetCore.Http;
3
using Microsoft.Extensions.Logging;
4
using Microsoft.Extensions.Options;
5
using System.Text.Encodings.Web;
@@ -33,7 +34,7 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync()
33
34
protected override Task HandleChallengeAsync(AuthenticationProperties properties)
35
{
36
// Set the response status code
- Response.StatusCode = 401; // Unauthorized
37
+ Response.StatusCode = StatusCodes.Status401Unauthorized;
38
39
// Generate the full resource metadata URL based on the current request
40
var baseUrl = $"{Request.Scheme}://{Request.Host}";
0 commit comments