Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b117d3

Browse filesBrowse files
committed
[BrowserKit] Uppercase the "GET" method in redirects
1 parent 37cd583 commit 7b117d3
Copy full SHA for 7b117d3

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎src/Symfony/Component/BrowserKit/Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Client.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public function followRedirect()
455455
$request = $this->internalRequest;
456456

457457
if (in_array($this->internalResponse->getStatus(), array(302, 303))) {
458-
$method = 'get';
458+
$method = 'GET';
459459
$files = array();
460460
$content = null;
461461
} else {
@@ -464,7 +464,7 @@ public function followRedirect()
464464
$content = $request->getContent();
465465
}
466466

467-
if ('get' === strtolower($method)) {
467+
if ('GET' === strtoupper($method)) {
468468
// Don't forward parameters for GET request as it should reach the redirection URI
469469
$parameters = array();
470470
} else {

‎src/Symfony/Component/BrowserKit/Tests/ClientTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Tests/ClientTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public function testFollowRedirectWithMaxRedirects()
410410
$client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected')));
411411
$client->request('POST', 'http://www.example.com/foo/foobar', array('name' => 'bar'));
412412

413-
$this->assertEquals('get', $client->getRequest()->getMethod(), '->followRedirect() uses a get for 302');
413+
$this->assertEquals('GET', $client->getRequest()->getMethod(), '->followRedirect() uses a GET for 302');
414414
$this->assertEquals(array(), $client->getRequest()->getParameters(), '->followRedirect() does not submit parameters when changing the method');
415415
}
416416

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.