How does the position of parameters in the query string affect the page?

I have an application with most of the code written in javascript. I'm having a weird problem. I have a query string and my application reads it to perform various actions. Yesterday I changed the order of the query string parameters and the app stopped working. If I return the original, then it starts working. What could be the reason? I thought the effect of the ordering of the parameters shouldn't matter. But apparently it matters for a reason. I'm still trying to figure out what the problem might be, but wanted to know if anyone has encountered a similar issue?

Thank.

+3


source to share


3 answers


A properly written application will find the given query parameter in any order and will not be order sensitive. However, it is possible to have poorly written parsing code that could only find a given parameter at the beginning, at the end, or only after some other parameter. Without seeing the code that parses the request parameters, we cannot tell what problem it has, but it is possible to have poorly written position-sensitive code.



If you post code that parses query parameters and a query string that works and another doesn't, we could be more specific. You should also check that your query parameters do not contain characters that need to be encoded, which can throw everything away.

+6


source


This shouldn't be a problem. Something else is causing the error. Or you have multiple dependencies on a variable location

that contains a url.



+1


source


I saw an issue like this where the developer used the query string as is as the key to the cached object. When the query string changed, the key was wrong and the caching mechanism failed (due to another error).

+1


source







All Articles