Is there a length limit for the fragment part of an URL (also known as the hash)?
相关问题
- facebook error invalid key hash for some devices
- UrlEncodeUnicode and browser navigation errors
- Improve converting string to readable urls
- Jasper: error opening input stream from url
- Change first key of multi-dimensional Hash in perl
相关文章
- Bcrypt vs Hash in laravel
- C# HttpClient.SendAsync always returns 404 but URL
- What is the fastest way to map group names of nump
- Prevent $anchorScroll from modifying the url
- How does a browser handle cookie with no path and
- Finding out whether there exist two identical subs
- Oracle STANDARD_HASH not available in PLSQL?
- Base64URL decoding via JavaScript?
It depends on the browser. I found that in safari, chrome, and Firefox, an URL with a long hash is legal, but if it is a param send to the server, the browser will display an 414 or 413 error.
for example: an URL like
http://www.stackoverflow.com/?abc#{hash value with 100 thousand characters}
will be ok. and you can use location.hash to get the hash value in javascript but an URL likehttp://www.stackoverflow.com/?abc&{query with 100 thousand characters}
will be illegal, if you paste this link in the address bar, a 413 error code will be given and the message isthe client issued a request that was too long
. If that is a link in a web page, in my computer, Nginx response the 414 error message.I don't know the situation in IE.
So I think, the limitation of the length of URL is just for transmission or HTTP server, the browser will check it sometimes, but not every time, and it will always be allowed to be used as a hash.
The hash is client side only, so the rules for HTTP may not apply to it.
There is definitely a length for the whole url.
Read
RFC2616 - Hypertext Transfer Protocol
Maximum URL length is 2,083 characters in Internet Explorer
What is the maximum length of a URL?