Is it legal or safe to depend on the ordering of the parameters of the URL request?

Is it legal or safe to depend on the ordering of the parameters of the URL request? In particular, I could write code and trust that this code would always work, which had a different behavior based on these two query lines:

?a=10&add=5&multiply=3    # might mean (10 + 5) * 3
?a=10&multiply=3&add=5    # might mean (10 * 3) + 5

(My example, of course, is contrived, I know that it’s ridiculous to build a calculator like this :) :)

+4
source share
1 answer

These query strings are perfectly legal and clear. According to RFC 3986 , the query string is no more than

... , ... URI

, HTML key=value application/x-www-form-urlencoded, HTML W3C. application/x-www-form-urlencoded:

application/x-www-form-urlencoded, ....

< > .

, application/x-www-form-urlencoded /.

, , - . , . , url.parse Node.js ( /` ), JavaScript .

+4

All Articles