Disable the Kestrel server header

We generally don’t want to expose information about the server we’re running our ASP.NET core application on.

In the case of Kestrel we can disable the server header using

var builder = WebApplication.CreateBuilder(args); 

builder.WebHost.UseKestrel(options => 
   options.AddServerHeader = false);