Skip to content

Instantly share code, notes, and snippets.

@naik899
Created March 8, 2019 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naik899/96efa72240e2b9c7b77e10fbf529f8cc to your computer and use it in GitHub Desktop.
Save naik899/96efa72240e2b9c7b77e10fbf529f8cc to your computer and use it in GitHub Desktop.
HttpModule
using System;
using System.Web;
namespace HtmlMinification
{
public class HttpModule : IHttpModule
{
void IHttpModule.Init(HttpApplication context)
{
context.BeginRequest += ContextBeginRequest;
}
private void ContextBeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if (app != null)
if (app.Request.RawUrl.Contains(".aspx"))
{
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