diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index cb3ed733..67b003d8 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -155,6 +155,7 @@ + diff --git a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs index 002693f6..902f45e6 100644 --- a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs +++ b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs @@ -647,11 +647,6 @@ public static partial class OpenIddictClientAspNetCoreHandlers /// public ValueTask HandleAsync(TContext context!!) { - // This handler only applies to ASP.NET Core requests. If the HTTP context cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetHttpRequest()?.HttpContext.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0114)); - Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); if (string.IsNullOrEmpty(context.Transaction.Response.Error)) diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs index 34a80ce2..cd8b5fe3 100644 --- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs +++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs @@ -1083,11 +1083,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers /// public ValueTask HandleAsync(TContext context!!) { - // This handler only applies to ASP.NET Core requests. If the HTTP context cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetHttpRequest()?.HttpContext.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0114)); - Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); if (string.IsNullOrEmpty(context.Transaction.Response.Error)) diff --git a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs index 50cc2d38..5bc324da 100644 --- a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs +++ b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs @@ -966,11 +966,6 @@ public static partial class OpenIddictServerOwinHandlers { Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); - // This handler only applies to OWIN requests. If The OWIN request cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetOwinRequest()?.Context.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0120)); - if (string.IsNullOrEmpty(context.Transaction.Response.Error)) { return default;