页面在 Firefox 上显示随机符号而不是错误消息 [英] Page displays random symbols instead of error message on Firefox

查看:43
本文介绍了页面在 Firefox 上显示随机符号而不是错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随机地,在一些项目中,一些页面显示随机符号而不是错误消息.喜欢这个:

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

I %&/m {J J t $@ iG#) * eVe]f@ 흼 { { ; N' ?fdl J ɞ! ?~|?" Ey')= y6h Ųi - ez 7i , 4 ̧i Ίe Ͼ|uz : } U{ ΋ ~ ȗu.- l>F' Y l $k tF { [ 'U |6J lR b6 юG k ^,ӏ }<~< ;cR鱕iV m | yDl tRͮ |N > Ey 裟 k !z Ѳ Y)5G A 8$D Ѥ̦oI ] P "/v[ W ~ m`N rvk Mqz3 wV

��������I�%&/m�{J�J��t��$@�����iG#)�*��eVe]f@�흼 ��{���{��;�N'���?fdl��J�ɞ!���?~|?"��Ey�')=��y6����h�����Ųi��- �ez����7i޴i�L���,�4�̧i���Ίe��Ͼ|uz����:�}���U{���������΋��~�ȗu.-�����l>F'�����Y�l��$k�tF������{�� ��[����'U���|6J�lR��b6��юG�k�^,ӏ��߿�}<~<�;c�R鱕iV��m�|��� �yDl���tRͮ�|N��>�Ey�裟�k��!z���Ѳ�Y)5��G��A�8$D��Ѥ̦oI��]�P �"�/��v[����W�~���m`N�rvk���Mqz3���wV�

它的发生非常随机,似乎是由不同的因素引起的.在这里,它正在上传文件.

It happens quite randomly, and seems to be caused by different factors. Here, it's on a file upload.

我们在此页面上使用 SharpZipLib,但代码路径不应使用它.

We use SharpZipLib on this page, but the codepath shouldn't use it.

有谁知道为什么会发生这种情况,以及如何预防?

Does anyone knows why this happens, and how to prevent it ?

它只发生在 Firefox 上.IE(8) 正确显示错误信息.

EDIT : it only happens on Firefox. IE(8) displays the error message correctly.

编辑 2: 它似乎是随机发生的,仅在某些页面/站点上.另一个 IIS 站点上的相同页面运行良好.似乎只在 IIS7 上这样做;我没有关于 IIS6 的报告,也没有在我的开发机器上遇到它.

EDIT 2 : it seems to happen quite randomly, only on some pages/sites. The same page on another IIS site works well. It seems to do this only on IIS7 ; I have no reports of those on IIS6, and I haven't encountered it on my dev machine.

编辑 3: 看起来它只在页面崩溃时发生.

EDIT 3 : it looks like it happens only when the page crashes.

编辑 4: 好的,所以,它只发生在 IIS7 上,并且只有当我收到错误 500 时才会发生.我认为可能是 IIS 错误页面有问题.我该如何尝试更改它们?

EDIT 4 : Ok, so, it happens only on IIS7, and only when I get an error 500. I think it might be the IIS error pages that have a problem. How can I try to change them ?

Firebug 给了我这些标题:

Firebug gives me those headers :

回应
缓存控制私有
内容类型文本/html;字符集=utf-8
服务器 Microsoft-IIS/7.0
X-AspNet-版本 2.0.50727
X-Powered-由 ASP.NET
日期 2011 年 4 月 4 日星期一 10:31:24 GMT
内容长度 2284
请求
主机 xxxx
用户代理 Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 (.NET CLR 3.5.30729; .NET4.0E)
接受 text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
接受语言 fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
接受编码 gzip、放气
接受字符集 ISO-8859-1,utf-8;q=0.7,*;q=0.7
保活 115
连接保持活动
推荐人 xxxxx
饼干xxxxxx

Response
Cache-Control private
Content-Type text/html; charset=utf-8
Server Microsoft-IIS/7.0
X-AspNet-Version 2.0.50727
X-Powered-By ASP.NET
Date Mon, 04 Apr 2011 10:31:24 GMT
Content-Length 2284
Request
Host xxxx
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729; .NET4.0E)
Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer xxxxx
Cookie xxxxxx

有什么办法让我说在这个页面上,我根本不接受 gzip 压缩"?

Is there any way for me to say "on this page, I don't accept gzip compression at all" ?

推荐答案

我没有找到任何真正的解决方案,但我找到了一个令人满意的解决方法.

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

请记住,问题仅在这些条件下出现:

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

  • 网站在 IIS7/Windows Server 2008 上配置.
  • 显示垃圾符号的页面实际上已经崩溃.生成的垃圾"实际上是一个 gzip 压缩的错误消息,尚未解压缩,或类似的东西.
  • 对动态或静态内容禁用 gzip 压缩不会改变任何内容

解决方法很简单:拒绝浏览器中的 gzip 压缩内容.在 Firefox 中,如 http://forgetmenotes.blogspot.com/中所示2009/05/how-to-disable-gzip-compression-in.html :

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. 在网址栏中输入 about:config(接受免责声明)
  2. 在 URL 栏下方的过滤器字段中输入编码
  3. 双击network.http.accept-encoding"行
  4. 清空值

在我的网站上,它用 CSS 做了一些奇怪的事情(而 StackOverflow 在那之后根本没有任何 CSS),但至少它正确地向我显示了错误消息,这使我能够修复错误.

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.

这篇关于页面在 Firefox 上显示随机符号而不是错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆