Skip to content
Permalink
Browse files

Remove trailing ;.

This prevents empty keys from sneaking into the parsed data.
  • Loading branch information...
markstory committed Jan 14, 2013
1 parent cc8153e commit 30c4c54b5d973bd01a9e39085d35f5ad98048042
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/Cake/Network/Http/Response.php
  2. +1 −1 lib/Cake/Test/TestCase/Network/Http/ResponseTest.php
@@ -136,6 +136,7 @@ protected function _parseHeaders($headers) {
* @return void
*/
protected function _parseCookie($value) {
$value = rtrim($value, ';');
$nestedSemi = '";"';
if (strpos($value, $nestedSemi) !== false) {
$value = str_replace($nestedSemi, "{__cookie_replace__}", $value);
@@ -153,7 +153,7 @@ public function testCookie() {
'HTTP/1.0 200 Ok',
'Set-Cookie: test=value',
'Set-Cookie: session=123abc',
'Set-Cookie: expiring=soon; Expires=Wed, 09-Jun-2021 10:18:14 GMT; Path=/; HttpOnly; Secure',
'Set-Cookie: expiring=soon; Expires=Wed, 09-Jun-2021 10:18:14 GMT; Path=/; HttpOnly; Secure;',
];
$response = new Response($headers, '');
$this->assertEquals('value', $response->cookie('test'));

0 comments on commit 30c4c54

Please sign in to comment.
You can’t perform that action at this time.