Skip to content

Instantly share code, notes, and snippets.

@hartviglarsen
Last active February 15, 2020 15:43
Show Gist options
  • Save hartviglarsen/a5b2d8a6587835864e377cd26926bf66 to your computer and use it in GitHub Desktop.
Save hartviglarsen/a5b2d8a6587835864e377cd26926bf66 to your computer and use it in GitHub Desktop.
public class WhitespaceModule : IHttpModule
{
public void Dispose() { }
public void Init(HttpApplication context)
{
context.BeginRequest += Context_BeginRequest;
}
private void Context_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
app.Response.Filter = new WhitespaceFilter(app.Response.Filter);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment