这是一个查询串的最大可能长度? [英] What is the maximum possible length of a query string?

查看:119
本文介绍了这是一个查询串的最大可能长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是依赖于浏览器?另外,做不同的网络协议栈有多少数据,他们可以从请求得到不同的限制?

Is it browser dependent? Also, do different web stacks have different limits on how much data they can get from the request?

推荐答案

RFC 2616 (超文本传输​​协议 - HTTP / 1.1)指出,没有限制的查询字符串(3.2.1节)的长度。 RFC 3986 还规定没有限制,但表示该主机名是有限的,因为DNS限制为255个字符(2.3节。 3)。

RFC 2616 (Hypertext Transfer Protocol — HTTP/1.1) states there is no limit to the length of a query string (section 3.2.1). RFC 3986 also states there is no limit, but indicates the hostname is limited to 255 characters because of DNS limitations (section 2.3.3).

虽然规格不指定任何最大长度,实际限制是通过Web浏览器和服务器软件的罚款。基于在 Boutell.com 发现研究的基础上:

While the specifications do not specify any maximum length, practical limits are imposed by web browser and server software. Based on the research found at Boutell.com:


  • 微软的Internet Explorer(浏览器)结果
    微软指出,在Internet Explorer中的URL的最大长度为2,083个字符,在URL的路径部分不超过2,048个字符。尝试使用的URL比这更长的产生在Internet Explorer中一个明确的错误消息。

  • Microsoft Internet Explorer (Browser)
    Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL. Attempts to use URLs longer than this produced a clear error message in Internet Explorer.

微软边缘(浏览器)结果
限制似乎是围绕81578个字符。见 URL长度限制微软边缘

Chrome浏览器结果
它停止的显示的在URL后64K字,但能为超过10万字。没有进一步的测试是超出完成的。

Chrome
It stops displaying the URL after 64k characters, but can serve more than 100k characters. No further testing was done beyond that.

火狐(浏览器)结果
经过65536个字符,在地址栏不再显示在Windows的Firefox 1.5.x.网址然而,较长的URL会工作。没有进一步的测试是经过100,000个字符完成。

Firefox (Browser)
After 65,536 characters, the location bar no longer displays the URL in Windows Firefox 1.5.x. However, longer URLs will work. No further testing was done after 100,000 characters.

Safari浏览器(浏览器)结果
80000以上的字符会工作。测试是没有尝试过不止于此。

Safari (Browser)
At least 80,000 characters will work. Testing was not tried beyond that.

歌剧(浏览器)结果
至少有19万个字符会工作。经过19万字已停止测试。适用于Windows Opera 9中继续显示完全可编辑,
在地址栏中可复制和pasteable URL甚至在19万字。

Opera (Browser)
At least 190,000 characters will work. Stopped testing after 190,000 characters. Opera 9 for Windows continued to display a fully editable, copyable and pasteable URL in the location bar even at 190,000 characters.

的Apache(服务器)结果
早期试图衡量撞上了约4000个字符的服务器URL长度的限制网页浏览器的最大URL长度,之后阿帕奇产生413实体太大错误。使用红帽企业Linux 4中发现的当前最新的Apache的版本。 Apache官方文档只提到在请求一个单独的领域的8,192字节的限制。

Apache (Server)
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. The current up to date Apache build found in Red Hat Enterprise Linux 4 was used. The official Apache documentation only mentions an 8,192-byte limit on an individual field in a request.

Microsoft Internet信息服务器(服务器)结果
默认的限额为16,384个字符(是的,微软的Web服务器比微软的网络浏览器接受更长的URL)。这是可配置的。

Microsoft Internet Information Server (Server)
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 ::守护程序(服务器)结果
截至8000个字节会工作。那些构建Web应用程序服务器与Perl的HTTP ::守护进程模块将遇到的所有的HTTP请求头的结合大小16,384字节的限制。这不包括POST方法的表单数据,文件上传等,但它确实包含的URL。在实践中,这产生了一个413错误,当一个URL大于8,000个字符显著更长。这种限制可以被容易地除去。寻找在Daemon.pm的16x1024所有出现,并与一个较大的值替换它们。当然,这会增加你置身于拒绝服务攻击。

Perl HTTP::Daemon (Server)
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.

这篇关于这是一个查询串的最大可能长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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