Product Engineer, CTO & a Beer Enthusiast
Experiments, thoughts and scripts documented for posterity.
Mar, 2010
What happens when you have GZip turned on and there is an unhandled exception is thrown, look no further.. a completely cryptic garbage page is returned
protected void Application_PreSendRequestHeaders()
{
if (HttpContext.Current != null && HttpContext.Current.Response != null)
{
HttpResponse response = HttpContext.Current.Response;
if (response.Filter is GZipStream &&
response.Headers["Content-encoding"] != "gzip")
{
response.AppendHeader("Content-encoding", "gzip");
}
else if (response.Filter is DeflateStream &&
response.Headers["Content-encoding"] != "deflate")
{
response.AppendHeader("Content-encoding", "deflate");
}
}
}