AJAX 调用在公司防火墙后面失败

发布于 2024-11-03 04:14:27 字数 431 浏览 1 评论 0原文

我使用 jQuery 的 $.ajax() 方法来获取大约 26KB 的 JSONP 数据。

从我测试过的每个位置(工作、家庭、手机等),数据都能在 FF、Chrome、IE 和 Safari 中完美返回。

唯一的例外是我的一位客户,他试图从公司的防火墙后面访问该网站。不幸的是,我无法让他向我提供响应,但我知道我的成功函数正在执行 - 所以响应似乎以某种方式被损坏,因为引用返回的 JSON 的任何内容都未定义。

我的问题是:防火墙是否可能对 XHR 响应的长度施加限制?还有其他一些我可能遗漏的明显解释吗?

非常感谢。

更新:

对于任何偶然发现这篇文章的人...我完全忘记了 AJAX 调用是使用非标准端口对我的一台开发服务器进行的。很肯定这就是他的防火墙不喜欢它的原因。

感谢所有发表评论的人。

I'm using jQuery's $.ajax() method to get about 26KB of JSONP data.

The data is returned perfectly in FF, Chrome, IE, and Safari from every location I've tested it (work, home, mobile phone, etc.).

The only exception is one of my clients who attempted to access the site from behind his company's firewall. Unfortunately, I was unable to get him to provide me with the response, but I know my success function is executing - so it seems that the response is being corrupted somehow, since anything that references the returned JSON is coming up undefined.

My question is this: is it possible that a firewall would place restrictions on the length of XHR responses? Is there some other obvious explanation that maybe I'm missing?

Many thanks.

UPDATE:

For anyone who happens to stumble upon this post... I had completely forgotten that the AJAX call was to one of my development servers using non-standard ports. Pretty sure that's why his firewall didn't like it.

Thanks to all who commented.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑脸一如从前 2024-11-10 04:14:27

我打算建议,除了你弄乱 URL 之外,一些防火墙还可以主动过滤请求,这可能会从你的请求中删除相关的 Java 脚本调用(偏执的网络造就了独特的开发环境)。

只是提醒那些将来可能会摸不着头脑的人,当他们的应用程序在这里、那里工作,但在企业环境中却不能在那里工作时。

I was going to suggest that apart from you messing up the urls, some firewalls have active filtering of requests, which might strip relevant java script calls from your requests (paranoid networks make for unique development environments).

Just a heads up to people that might be scratching their head in the future when their apps work here, there but not OVER there in a corporate setting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文