aspnet / KestrelHttpServer

[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
2.63k stars 528 forks source link

Server header still present after setting AddServerHeader to false #3098

Closed mmulhearn closed 5 years ago

mmulhearn commented 5 years ago

Referring to https://github.com/aspnet/KestrelHttpServer/issues/852, the following code should remove the Server header from the response:

 public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseKestrel(k => k.AddServerHeader = false)
                .UseStartup<Startup>();

However, I am still seeing Server: Kestrel header in the response. I have killed the process and re-built multiple times to no change.

Using Asp.Net Core 2.1.1.

shirhatti commented 5 years ago

Tried on 2.1, does not repro.

shirhatti commented 5 years ago

@mmulhearn Feel free to re-open if you can provide more information on how you're seeing this.

mmulhearn commented 5 years ago

Just went and retired (having updated nugets and VS itself since then) and can no longer reproduce. Not sure what happened there. Looks good now. Thanks.