mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX HTTPResponse::removeHeader incorrectly converts header name to lowercase
This commit is contained in:
parent
3312a68dc2
commit
cc90cb0125
@ -245,7 +245,7 @@ class HTTPResponse
|
||||
*/
|
||||
public function removeHeader($header)
|
||||
{
|
||||
strtolower($header);
|
||||
$header = strtolower($header);
|
||||
unset($this->headers[$header]);
|
||||
return $this;
|
||||
}
|
||||
|
@ -47,4 +47,15 @@ class HTTPResponseTest extends SapphireTest
|
||||
// Fail if we get to here
|
||||
$this->assertFalse(true, 'Something went wrong with our test exception');
|
||||
}
|
||||
|
||||
public function testRemoveHeader()
|
||||
{
|
||||
$response = new HTTPResponse();
|
||||
|
||||
$response->addHeader('X-Animal', 'Monkey');
|
||||
$this->assertSame('Monkey', $response->getHeader('X-Animal'));
|
||||
|
||||
$response->removeHeader('X-Animal');
|
||||
$this->assertEmpty($response->getHeader('X-Animal'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user