c# forbidden.html,403 Forbidden错误的浏览器行为

当用户尝试访问他们无权访问的资源时,我的服务器返回403禁止错误。除了头部,服务器还会写一条描述错误的小消息。

在Firefox中,错误消息很好地显示,用户知道发生了什么。

在Internet Explorer中,消息被隐藏并替换为403 Forbidden标准错误页面。

是否有任何特定规则允许我在所有浏览器中显示错误消息,同时仍将状态设置为403 Forbidden?

以下是此状态的RFC信息:

The server understood the request, but

is refusing to fulfill it.

Authorization will not help and the

request SHOULD NOT be repeated. If the

request method was not HEAD and the

server wishes to make public why the

request has not been fulfilled, it

SHOULD describe the reason for the

refusal in the entity. If the server

does not wish to make this information

available to the client, the status

code 404 (Not Found) can be used

instead.

好像我应该设置一条消息,但IE不会显示它。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值