bool CanRewriteOutput(HttpContextBase httpContext)
{
var statusCode = httpContext.Response.StatusCode;
if (300 <= statusCode && statusCode < 400) return false;
if (statusCode == 401) return false; // 401 gets converted into a redirect by FormsAuthenticationBundle.
return IsHtmlResponse(httpContext);
}