为什么我在一个网络上收到 HTTP 代码 414 而在另一个网络上却没有?

发布于 2024-09-05 04:38:39 字数 344 浏览 3 评论 0原文

我有一个可以正常运行的 iPhone 程序。最近的一项更改意味着它会生成一些非常长的 URL(有时超过 4000 个字符),我知道这不是一个好主意,而且我知道如何修复 - 这不是我在这里要问的。

奇怪的是,当我使用 3G 网络(英国沃达丰)进行连接时,我收到此 HTTP“414 Request-URI Too Long”错误,但当我使用本地 WiFi 连接进行连接时,它工作得很好。

为什么使用不同类型的网络会得到不同的结果?他们是否可以根据连接的来源将请求路由到不同的服务器?或者这里还有其他的利害关系吗?

推论的问题与这种情况的普遍程度有关。每当我使用蜂窝网络或仅使用某些网络时是否可能会发生这种情况?

I have an otherwise working iPhone program. A recent change means that it generates some very long URLs (over 4000 characters sometimes) which I know isn't a great idea and I know how to fix -- that's not what I'm asking here.

The curious thing is that when I make the connection using a 3G network (Vodafone UK) I get this HTTP "414 Request-URI Too Long" error but when I connect using my local WiFi connection it works just fine.

Why would I get different results using different types of network? Could they be routing requests to different servers depending on where the connection originates? Or is there something else at stake here?

The corollary questions relate to how common this is. Is it likely to happen whenever I use a cell network or just some networks?

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

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

发布评论

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

评论(3

终陌 2024-09-12 04:38:39

我怀疑您的 3G 请求正在通过某个代理传递,该代理不喜欢 4000 个字符长的 URL,并返回 HTTP 414 错误。

I would suspect that your 3G requests are being passed through some proxy which doesn't fancy 4000 char long URLs, and returns an HTTP 414 error.

掀纱窥君容 2024-09-12 04:38:39

我怀疑沃达丰连接正在通过无法处理超长 URL 的代理和/或网关,并且您的 414 Request-URI Too Long 来自它。

I suspect the Vodafone connection is going through a proxy and/or gateway that can't handle the extra-long URL, and that your 414 Request-URI Too Long is coming from it.

十二 2024-09-12 04:38:39

一些无线运营商(我相信包括沃达丰英国)部署内联代理,透明地拦截您的 HTTP 请求以达到优化目的。其中一些代理基于 Squid 代理缓存等软件,这些软件在处理很长的 URL 时可能会出现问题。因此,您的请求甚至可能无法到达您的服务器。

要解决此问题,您可以尝试通过非标准 TCP 端口将 HTTP 请求发送到服务器。一般来说,这些代理仅配置为在端口 80 上执行 HTTP 处理。因此,如果您可以在不同端口上发送流量,则可能会毫发无伤地通过。

Some wireless operators - including Vodafone UK, I believe - deploy inline proxies that transparently intercept your HTTP requests for purposes of optimization. Some of these proxies are based on software like the Squid proxy cache, which can have problems with very long URLs. As a result, your requests might not even be making it to your server.

To work around this issue, you can try sending your HTTP requests to the server on a non-standard TCP port. Generally speaking, these proxies are only configured to perform HTTP processing on port 80. Thus, if you can send your traffic on a different port, it might make it through unscathed.

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