Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, October 5, 2018 7:45 AM
Hello all!
Is there a standard way in .net core to remove Server: Kestrel header from asp.net core 2 http response in my webapp?
Thank you.
All replies (1)
Friday, October 5, 2018 9:07 AM âś…Answered
Hi Alex9 ,
You could remove the Server header by setting the AddServerHeader property to false on KestrelServerOptions, this can be done in the Program.cs.
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseKestrel(options => options.AddServerHeader = false)
.UseStartup<Startup>();
Best Regards
Sherry