Page displays random symbols instead of error message on Firefox

后端 未结 4 692
梦毁少年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条回答
  •  佛祖请我去吃肉
    2020-12-10 04:16

    I did not find any real solution, but I found a satisfying workaround.

    Keep in mind that the problem only arises under those conditions :

    • The website is configured on IIS7 / Windows Server 2008.
    • The page displaying the garbage symbols has, in reality, crashed. The resulting "garbage" is, in fact, an gzip-compressed error message that has not been decompressed, or something like that.
    • Disabling gzip compression on either dynamic or static content does'nt change anything

    The workaround is simple : refuse gzip-compressed content in the browser. In Firefox, as seen in http://forgetmenotes.blogspot.com/2009/05/how-to-disable-gzip-compression-in.html :

    1. Type about:config in the URL bar (Accept the disclaimer)
    2. Type encoding in the filter field underneath the URL bar
    3. Doubleclick the line "network.http.accept-encoding"
    4. Empty the value

    On my website, it did some weird things with the CSS (and StackOverflow does not have any CSS at all after that), but at least it correctly showed me the error message, which enabled me to fix the bug.

    Hopefully it will help someone.

提交回复
热议问题