您可以传递给 Wininet 函数 HttpOpenRequest 的最大 URL 长度是多少? [英] What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest?

查看:29
本文介绍了您可以传递给 Wininet 函数 HttpOpenRequest 的最大 URL 长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以传递给 Wininet 函数 HttpOpenRequest 的最大 URL 长度是多少?

What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest?

推荐答案

HttpOpenRequest 没有最大长度,但您的目标服务器软件可能会限制您的 URL 长度.

HttpOpenRequest does not have a maximum length but server software you are targeting will likely have a limit on your URL length.

Apache(服务器)

我早期尝试衡量Web 浏览器中的最大 URL 长度遇到服务器 URL 长度限制大约 4,000 个字符,之后 Apache 产生一个413实体太大"错误.我使用了找到最新的 Apache 构建在 Red Hat Enterprise Linux 4 中.仅限官方 Apache 文档提到了一个 8,192 字节的限制请求中的单个字段.

My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat Enterprise Linux 4. The official Apache documentation only mentions an 8,192-byte limit on an individual field in a request.

Microsoft Internet Information Server(服务器)

默认限制为 16,384 个字符(是的,Microsoft 的 Web 服务器接受比微软网站更长的 URL浏览器).这是可配置的.

The default limit is 16,384 characters (yes, Microsoft's web server accepts longer URLs than Microsoft's web browser). This is configurable.

Perl HTTP::Daemon(服务器)

最多可以使用 8,000 个字节.那些构建 Web 应用服务器使用 Perl 的 HTTP::Daemon 模块将遇到 16,384 字节的限制所有 HTTP 请求的总大小标题.这不包括POST方法表单数据,文件上传,等等,但它确实包含 URL.在实践这导致了 413 错误当 URL 明显更长时超过 8,000 个字符.这个限制可以很容易地去除.寻找所有Daemon.pm 中出现 16x1024并用更大的值替换它们.当然,这确实增加了你的暴露于拒绝服务攻击.

Up to 8,000 bytes will work. Those constructing web application servers with Perl's HTTP::Daemon module will encounter a 16,384 byte limit on the combined size of all HTTP request headers. This does not include POST-method form data, file uploads, etc., but it does include the URL. In practice this resulted in a 413 error when a URL was significantly longer than 8,000 characters. This limitation can be easily removed. Look for all occurrences of 16x1024 in Daemon.pm and replace them with a larger value. Of course, this does increase your exposure to denial of service attacks.

(来自 Boutell.com)

这篇关于您可以传递给 Wininet 函数 HttpOpenRequest 的最大 URL 长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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