Garbled error page output using Gzip in ASP.NET / IIS7

后端 未结 2 934
广开言路
广开言路 2021-02-02 15:11

I\'ve implemented Rick Strahl\'s GZipEncodePage method on my site and it works great for the site itself. However, when my code throws an exception the \"Server Error\" page lo

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 15:49

    I'm understand that this question is really outdated.

    On Application_Error remove Filters from Response, like this

     protected void Application_Error(Object sender, EventArgs e)
     {
        HttpApplication app = sender as HttpApplication;
        app.Response.Filter = null;
     }
    

    Hope this helps anybody.

提交回复
热议问题