suncat2000/MobileDetectBundle — pull request #57 by mhlavac (2014-07-09 08:29:13+00:00)
Title: Update MobileDetector user agent after master request

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT

Hello, please let me know if I do something wrong here.

I had problems running Symfony functional tests with MobileDetectBundle. All requests I make are using user-agent `Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36` (android nexus 7), I checked and user-agent is correctly set in $request in headers, server request parameter bag. When I do multiple requests in one functional test, then i get correct device from `MobileDetect` only for first request, for all subsequent requests it returns `is_tablet() == false; // true`

This PR fixes this issue, it sets user-agent in `MobileDetech` for each master request.

I can add functional test that simulates the problem as well, but I wanted to know if I am doing stuff right first, because to do functional test I would have to set up symfony environment to test this bundle.

Thank you for your work on this bundle, helped me a lot :-)