Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an equals sign appear after the first equals sign in a query parameter?

For example, is this a valid URL:

http://0.0.0.0:8080/auth/reset?id=AAAAAAAAAAA=&code=uX8kklWhVi-Vhp4BdMRQYBEveEdwQXBFDecLlsT6yBw=

From what I've researched it seems to be discouraged (but I haven't found anything definitive), but all the decoders I've tested it with decode it correctly. This includes:

  • Google Chrome
  • Firefox
  • NodeJS' decodeURIComponent
like image 571
Shien Avatar asked Feb 28 '17 10:02

Shien


People also ask

Does order matter in query parameters?

A properly written application will find a given query parameter in any order and will not be order sensitive.

How does a query string work?

Query String is a group of keywords that send request to the web server. These requests are used to pass information (parameters) from one page to another and you can access those information in receiving page. It containing in the HTTP requests for a specific URL.

Where we use query string?

A Query String Collection is used to retrieve the variable values in the HTTP query string. If we want to transfer a large amount of data then we can't use the Request. QueryString. Query Strings are also generated by form submission or can be used by a user typing a query into the address bar of the browsers.


1 Answers

The key=value format in the query component is just a convention.

The = is allowed in the query component, and it has no reserved meaning there.

So yes, it is a valid URI.

How the parameters get parsed depends on the specific implementation. As the parameters are typically separated by a &, it would make sense to interpret additional = characters as part of the value.

like image 121
unor Avatar answered Oct 04 '22 08:10

unor