Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sorting query string if not necessary (on redirects) #5232

Closed
leshatai opened this issue Aug 10, 2012 · 1 comment
Closed

Avoid sorting query string if not necessary (on redirects) #5232

leshatai opened this issue Aug 10, 2012 · 1 comment

Comments

@leshatai
Copy link

I am implementing a REST-WS with symfony using HMAC for security.
So, when calculating the check sum I build a string containing any data send to the server.
On the server side I have to recalculate the check sum, but as GET-Parameters are getting
sorted when calling $request->getQueryString() this leads to an other check sum, so the authentication
fails, even everything else is fine.

I also tried to use $request->server->get('QUERY_STRING') but this does not work as it seems that the request
is redirected ( https://github.com/fabpot/Silex/issues/149 ) even with GET - parameters.
So /an/uri?b=2&a=1 becomes /an/uri/?a=1&b=2, which would be ok, but the params are sorted as well, which
causes a false check sum.

It would be nice $request->server->get('QUERY_STRING') always returns the original parameter order.

@fabpot
Copy link
Member

fabpot commented Jan 10, 2013

$request->server->get('QUERY_STRING') does return the original query string.

@fabpot fabpot closed this as completed Jan 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants