MobileDetectBundle icon indicating copy to clipboard operation
MobileDetectBundle copied to clipboard

Fix : Redirect to request Uri instead of pathInfo

Open vrcAlbert opened this issue 8 years ago • 2 comments

Hello,

Asking for http://hostname.dev/app_dev.php/path redirects to http://m.hostname.dev/path and does not preserve app_dev.php.

Is there any reason for using pathInfo instead of request URI ?

If not, here's the change you could merge.

Thanks in advance for your time and answer.

vrcAlbert avatar Aug 04 '16 14:08 vrcAlbert

@vrcAlbert : The issue however is that the Request::getRequestUri() method also returns the query string.

You may want to remove this line:

- Request::normalizeQueryString(http_build_query($queryParams, null, '&'))

But still, l.287 is added the switch param, which is not part of the current request.

So, I'd suggest to simply concatenate the result of the Request::getBaseUrl() method instead.

This fix should also be applied to the RequestResponseListener::REDIRECT_WITHOUT_PATH case.

ogizanagi avatar Aug 08 '16 12:08 ogizanagi

Thanks @ogizanagi for pointing that out !

Concerning REDIRECT_WITHOUT_PATH, there could be a case in which we would use that option to explicitely remove the base script. I'll let @suncat2000 giving his final word about it :)

Thanks again for the review.

vrcAlbert avatar Aug 09 '16 07:08 vrcAlbert