瀏覽代碼

Use GetEndpoint extension method (#10745)

Kahbazi 6 年之前
父節點
當前提交
c7cb8467bf
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Http/Routing/src/EndpointMiddleware.cs

+ 1 - 1
src/Http/Routing/src/EndpointMiddleware.cs

@@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Routing
 
 
         public Task Invoke(HttpContext httpContext)
         public Task Invoke(HttpContext httpContext)
         {
         {
-            var endpoint = httpContext.Features.Get<IEndpointFeature>()?.Endpoint;
+            var endpoint = httpContext.GetEndpoint();
             if (endpoint?.RequestDelegate != null)
             if (endpoint?.RequestDelegate != null)
             {
             {
                 if (!_routeOptions.SuppressCheckForUnhandledSecurityMetadata)
                 if (!_routeOptions.SuppressCheckForUnhandledSecurityMetadata)