Skip to content

Commit 6df196c

Browse files
authored
Suppress routing auth check in benchmark server (#1014)
1 parent 4c92b23 commit 6df196c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

perf/benchmarkapps/GrpcAspNetCoreServer/Startup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Microsoft.AspNetCore.Authentication.Certificate;
2525
using Microsoft.AspNetCore.Builder;
2626
using Microsoft.AspNetCore.Http;
27+
using Microsoft.AspNetCore.Routing;
2728
using Microsoft.Extensions.Configuration;
2829
using Microsoft.Extensions.DependencyInjection;
2930
using Microsoft.Extensions.Hosting;
@@ -44,9 +45,14 @@ public void ConfigureServices(IServiceCollection services)
4445
{
4546
services.AddGrpc(o =>
4647
{
47-
// Small performance benefits to not add catch-all routes to handle UNIMPLEMENTED for unknown services
48+
// Small performance benefit to not add catch-all routes to handle UNIMPLEMENTED for unknown services
4849
o.IgnoreUnknownServices = true;
4950
});
51+
services.Configure<RouteOptions>(c =>
52+
{
53+
// Small performance benefit to skip checking for security metadata on endpoint
54+
c.SuppressCheckForUnhandledSecurityMetadata = true;
55+
});
5056
services.AddSingleton<BenchmarkServiceImpl>();
5157
services.AddControllers();
5258

0 commit comments

Comments
 (0)