This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier da6f190a6b merged branch tiraeth/master-browserkit-redirect (PR #8025)
This PR was squashed before being merged into the master branch (closes #8025).

Discussion
----------

[BrowserKit] should not follow redirects if status code is not 30x

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

Currently, BrowserKit operates incorrectly. It follows "redirect" when `Location` header is present, but having just the header is not enough to perform redirection. [RFC-2616](http://tools.ietf.org/html/rfc2616#section-14.30) precisely says that the redirection should be performed only with `30x` status codes.

This PR fixes the incorrect behaviour of BrowserKit and make it consist with both the RFC document and with other clients, used for example with Behat.

I've found the issue while testing my application with Behat. I was returning `Location` header with `HTTP 201/Created` status code and was surprised that BrowserKit follows the redirection.

This PR is for 2.3 version (master) of Symfony.

Commits
-------

8f54da7 [BrowserKit] should not follow redirects if status code is not 30x
2013-05-15 17:16:47 +02:00
..
BrowserKit merged branch tiraeth/master-browserkit-redirect (PR #8025) 2013-05-15 17:16:47 +02:00
ClassLoader Merge branch '2.2' 2013-05-06 22:03:44 +02:00
Config Merge branch '2.2' 2013-05-10 20:12:13 +02:00
Console tweaked previous merge (refs #8029) 2013-05-15 17:12:03 +02:00
CssSelector merged branch dantleech/enforce_sprintf_for_exceptions (PR #7620) 2013-04-11 08:50:46 +02:00
Debug removed versions in composer.json files 2013-05-13 16:36:40 +02:00
DependencyInjection removed versions in composer.json files 2013-05-13 16:36:40 +02:00
DomCrawler removed versions in composer.json files 2013-05-13 16:36:40 +02:00
EventDispatcher removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Filesystem Merge branch '2.2' 2013-05-06 22:03:44 +02:00
Finder [Finder] Fix tests on windows 2013-04-25 14:12:10 +02:00
Form removed versions in composer.json files 2013-05-13 16:36:40 +02:00
HttpFoundation [HttpFoundation][File][UploadedFile] Fix guessClientExtension() method 2013-05-10 08:00:03 +02:00
HttpKernel removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Intl added missing license blocks 2013-04-22 06:31:56 +02:00
Locale [Locale] Removed "Stub" prefixes in Intl component 2013-04-11 11:29:25 +02:00
OptionsResolver Enforce sprintf for exceptions 2013-04-11 08:50:46 +02:00
Process Merge branch '2.2' 2013-05-06 22:03:44 +02:00
PropertyAccess merged branch danielholmes/prop_access_additions (PR #7876) 2013-04-30 18:43:32 +02:00
Routing removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Security removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Serializer Merge branch '2.2' 2013-05-10 20:12:13 +02:00
Stopwatch [Stopwatch] Fix array definition from 5.4 2013-04-17 10:17:10 +03:00
Templating Merge branch '2.2' 2013-04-17 07:31:37 +02:00
Translation removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Validator removed versions in composer.json files 2013-05-13 16:36:40 +02:00
Yaml Merge branch '2.2' 2013-05-10 20:12:13 +02:00