Skip to content

Instantly share code, notes, and snippets.

@ChrisMissal
Created June 1, 2011 16:32
Show Gist options
  • Save ChrisMissal/1002702 to your computer and use it in GitHub Desktop.
Save ChrisMissal/1002702 to your computer and use it in GitHub Desktop.
This HttpModule removes the Server header from an ASP.NET Response.
public class CustomServerHeaderModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.PreSendRequestHeaders += (sender, e) => ((HttpApplication)sender).Response.Headers.Remove("Server");
}
public void Dispose()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment