Page displays random symbols instead of error message on Firefox

后端 未结 4 694
梦毁少年i
梦毁少年i 2020-12-10 03:47

Randomly, on a few projects, some pages display random symbols instead of an error message. Like this one :

��������I�%&/m�{J�J��t��$@�����iG#)�*��e

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 04:13

    Another workaround for anyone stumbling across this could be to remove the response filter on application error, which will get rid of the encoding and send it through uncompressed. Since this is only for error messages the impact on performance should be minimal.

    In your Global.asax

    VB

    Sub Application_Error()
        Response.Filter = Nothing
    End Sub
    

    C# (I assume this is right, see blog link below)

    protected void Application_Error(object sender, EventArgs e)
    {
        Response.Filter = null;
    }
    

    All credit to Rick Strahl with this blog post for the workaround.

    Note: I also added this an an answer to my own question here - IISExpress garbled HTTP 500 error message

提交回复
热议问题