http 1.1 协议中对url的长度是不受限制的:
The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).
翻译:
HTTP协议不对URI的长度作事先的限制,服务器必须能够处理任何他们提供资源的URI,并且应该能够处理无限长度的URIs,这种无效长度的URL可能会在客户端以基于GET方式的请求时产生。如果服务器不能处理太长的URI的时候,服务器应该返回414状态码(此状态码代表Request-URI太长)。
浏览器对url长度限制
浏览器 | 最大长度(字符数) | 备注 |
---|---|---|
Internet Explorer | 2083 | 如果超过这个数字,提交按钮没有任何反应 |
Firefox | 65,536 | |
chrome | 8,182 | |
Safari | 80,000 | |
Opera | 190,000 | |
curl(linux下指令) | 8,167 |
web服务器对于url长度限制
服务器 | 最大长度(字符数) | 备注 |
---|---|---|
Apache (Server) | 8,192 | |
Microsoft Internet Information Server(IIS) | 16,384 | |
nginx | 4,096 (默认) | large_client_header_buffers 最大缓冲区大小设置,默认是4K,可以根据情况而增大 |
tomcat | 65,536 | maxHttpHeaderSize 设置最大请求头长度, |
浏览器对cookie数目的限制
浏览器 | 个数限制(每个域下) | 备注 |
---|---|---|
Internet Explorer | 50(IE6及以下是20) | |
Firefox | 50 | 最后的设置的Cookie始终保留 |
chrome | 180 | |
Safari | 无限制 | |
Opera | 30 |
浏览器对于cookie长度限制
浏览器 | 最大长度(字节) |
---|---|
Internet Explorer | 4,095 |
Firefox | 4,097 |
chrome | 4,097 |
Safari | 4,097 |
Opera | 4,096 |
多字节字符计算为两个字节。在所有浏览器中,任何cookie大小超过限制都被忽略,且永远不会被设置。
<iframe data-google-container-id="a!3" data-google-query-id="CJ_ysLzng_8CFQFSvQodXAcNug" data-load-complete="true" frameborder="0" height="0" id="aswift_2" marginheight="0" marginwidth="0" name="aswift_2" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-3426945312236276&output=html&h=0&adk=2656897163&adf=224828298&w=0&lmt=1684582668&rafmt=12&format=0x0&url=http%3A%2F%2Fwww.taodudu.cc%2Fnews%2Fshow-369781.html%3Faction%3DonClick&wgl=1&dt=1684582668298&bpp=6&bdt=42&idt=76&shv=r20230517&mjsv=m202305160101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D407ee6ea3f42ae21-225e10ea44df0044%3AT%3D1681993813%3ART%3D1684582667%3AS%3DALNI_MZ-4wnR5Kgc8cWnN30YQeEEAoqrAA&gpic=UID%3D00000bfae560f625%3AT%3D1681993813%3ART%3D1684582667%3AS%3DALNI_MZlZLC89Tsx_5dSTvVnRw27qAzq2w&prev_fmts=0x0%2C708x90&nras=1&correlator=167739328673&frm=20&pv=1&ga_vid=7292974.1684582668&ga_sid=1684582668&ga_hid=335417399&ga_fc=0&u_tz=480&u_his=2&u_h=1080&u_w=1920&u_ah=1040&u_aw=1920&u_cd=24&u_sd=1&adx=438&ady=1967&biw=1903&bih=969&scr_x=0&scr_y=0&eid=44792108%2C44759875%2C44759926%2C44759837%2C44788441%2C44789779&oid=2&pvsid=4392403680267668&tmod=350662479&uas=0&nvt=1&ref=http%3A%2F%2Fwww.taodudu.cc%2Fnews%2Fshow-369781.html&fc=1920&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1040%2C1920%2C969&vis=1&rsz=%7C%7Coebr%7C&abl=CS&fu=256&bc=23&ifi=3&uci=a!3&btvi=1&fsb=1&xpc=amkJQocNat&p=http%3A//www.taodudu.cc&dtd=79" width="0"></iframe>转载于:https://my.oschina.net/ZL520/blog/2995860
标签:限制,web,浏览器,get,URL,Internet,URI,服务器,长度 From: https://www.cnblogs.com/chinasoft/p/17417694.html