Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix invalid exception from urlencoded cookie value
Browse files Browse the repository at this point in the history
Fix #15
  • Loading branch information
zerocrates committed Sep 12, 2015
1 parent 665a976 commit 83bcfc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Header/SetCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ public function getName()
*/
public function setValue($value)
{
HeaderValue::assertValid($value);
$this->value = $value;
return $this;
}
Expand Down
3 changes: 2 additions & 1 deletion test/Header/SetCookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace ZendTest\Http\Header;

use Zend\Http\Header\HeaderValue;
use Zend\Http\Header\SetCookie;

class SetCookieTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -431,8 +432,8 @@ public function testPreventsCRLFAttackViaFromString()
*/
public function testPreventsCRLFAttackViaConstructor()
{
$this->setExpectedException('Zend\Http\Header\Exception\InvalidArgumentException');
$header = new SetCookie("leo_auth_token", "example\r\n\r\nevilContent");
$this->assertTrue(HeaderValue::isValid($header->getFieldValue()));
}

public function setterInjections()
Expand Down

0 comments on commit 83bcfc1

Please sign in to comment.