{"action":"opened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/17351","labels_url":"https://api.github.com/repos/symfony/symfony/issues/17351/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/17351/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/17351/events","html_url":"https://github.com/symfony/symfony/issues/17351","id":126436302,"number":17351,"title":"[2.7+] HTTP_USER_AGENT for client is ignored in WebTestCase","user":{"login":"pculka","id":4672645,"avatar_url":"https://avatars.githubusercontent.com/u/4672645?v=3","gravatar_id":"","url":"https://api.github.com/users/pculka","html_url":"https://github.com/pculka","followers_url":"https://api.github.com/users/pculka/followers","following_url":"https://api.github.com/users/pculka/following{/other_user}","gists_url":"https://api.github.com/users/pculka/gists{/gist_id}","starred_url":"https://api.github.com/users/pculka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pculka/subscriptions","organizations_url":"https://api.github.com/users/pculka/orgs","repos_url":"https://api.github.com/users/pculka/repos","events_url":"https://api.github.com/users/pculka/events{/privacy}","received_events_url":"https://api.github.com/users/pculka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-13T14:56:31Z","updated_at":"2016-01-13T14:56:31Z","closed_at":null,"body":"Imagine a scenario, where you need to follow redirects based on user_agent, having the default user_agent set in phpunit.xml. But for the sake of this, let's just remove the phpunit.xml UA definition\r\n\r\nnow following:\r\nhttp://pastebin.com/RsNQgjMZ\r\n\r\nends up with $_SERVER['HTTP_USER_AGENT'] being not set, resulting in an exception in the MainController and killing the testing process with a Fail.\r\n\r\nI tried to trace down the problem and found that in\r\nBrowserKit\\Client, around the line 302 the `$this->request` is still being populated with correct user agent, but SOMEHOW this gets removed for whatever reason while performing `$this->response = $this->doRequest($this->request);`\r\n\r\nCan anybody explain WHY is this happening? and HOW can I properly assert getting 301 Code if hitting MainController with a predefined useragent?\r\n\r\nThanks\r\n"}}