1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 01:53:58 +01:00

Merge pull request #1232 from spyric/bad_cookie

Fix incorrect equal sign in cookie value
This commit is contained in:
Michael Dowling 2015-09-01 16:14:13 -07:00
commit 33af93ab4b
2 changed files with 3 additions and 1 deletions

View File

@ -69,7 +69,7 @@ class CookieJar implements CookieJarInterface
{
if (substr($value, 0, 1) !== '"' &&
substr($value, -1, 1) !== '"' &&
strpbrk($value, ';,')
strpbrk($value, ';,=')
) {
$value = '"' . $value . '"';
}

View File

@ -32,6 +32,8 @@ class CookieJarTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals('foo', CookieJar::getCookieValue('foo'));
$this->assertEquals('"foo,bar"', CookieJar::getCookieValue('foo,bar'));
$this->assertEquals('"foobar="', CookieJar::getCookieValue('foobar='));
$this->assertEquals('"foo;bar"', CookieJar::getCookieValue('foo;bar'));
}
public function testCreatesFromArray()