带有正斜杠的哈希碎片在IE中通过AJAX请求引发403错误 [英] Hash fragments with forward-slash throwing 403 errors with AJAX requests in IE

查看:142
本文介绍了带有正斜杠的哈希碎片在IE中通过AJAX请求引发403错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网址类似于: http://www.example.com/#!/test/



以及在散列片段为 / test / 时处理的AJAX请求。
AJAX请求很好,除了在IE中抛出403错误。它适用于所有其他浏览器。



现在,如果我将URL更改为: http://www.example.com/#!测试/



它工作得很好。我无法更改当前的散列片段URL结构。任何解决方案/建议?

解决方案

使用网络调试器(例如www.fiddler2.com)并确定HTTP请求的结果是服务器发回不同的响应。我的猜测是,您从哈希中获取数据的方式会导致在浏览器之间向服务器发送不同的查询(例如,包括#或缺少#),并导致服务器将403返回到IE。

I have a URL similar to: http://www.example.com/#!/test/

And an AJAX request that is handled when the hash fragment is /test/. The AJAX request is fine except in IE, where it throws a 403 error. It works fine in all other browsers.

Now, if I change the URL to: http://www.example.com/#!test/

It works just fine. I can't change my current hash fragment URL structure. Any solutions/suggestions?

解决方案

Use a network debugger (e.g. www.fiddler2.com) and determine what the difference in the HTTP request is that results in the server sending back a different response. My guess is that the way that you're getting the data out of the hash results in sending a different query to the server between browsers (e.g. includes "#" or lacks "#") and that causes the server to return the 403 to IE.

这篇关于带有正斜杠的哈希碎片在IE中通过AJAX请求引发403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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