mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Setting cookies in a single line. Fixes #48
This commit is contained in:
parent
5945edd983
commit
9bbaf153f7
2 changed files with 2 additions and 2 deletions
|
@ -975,7 +975,7 @@ class HttpSocket extends CakeSocket {
|
||||||
foreach ($cookies as $name => $cookie) {
|
foreach ($cookies as $name => $cookie) {
|
||||||
$header[] = $name.'='.$this->_escapeToken($cookie['value'], array(';'));
|
$header[] = $name.'='.$this->_escapeToken($cookie['value'], array(';'));
|
||||||
}
|
}
|
||||||
$header = $this->_buildHeader(array('Cookie' => $header), 'pragmatic');
|
$header = $this->_buildHeader(array('Cookie' => implode('; ', $header)), 'pragmatic');
|
||||||
return $header;
|
return $header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1375,7 +1375,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
'path' => '/accounts'
|
'path' => '/accounts'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$expect = "Cookie: foo=bar\r\nCookie: people=jim,jack,johnny\";\"\r\n";
|
$expect = "Cookie: foo=bar; people=jim,jack,johnny\";\"\r\n";
|
||||||
$result = $this->Socket->buildCookies($cookies);
|
$result = $this->Socket->buildCookies($cookies);
|
||||||
$this->assertEqual($result, $expect);
|
$this->assertEqual($result, $expect);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue