Skip to content

Commit

Permalink
Limit header size
Browse files Browse the repository at this point in the history
Extra check for header size.
  • Loading branch information
barryvdh committed Dec 15, 2013
1 parent 710ba0b commit 053633e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Barryvdh/Debugbar/SymfonyHttpDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ public function __construct($session, $response = null){
function setHeaders(array $headers)
{
if(!is_null($this->response)){
$this->response->headers->add($headers);
$size = 0;
foreach($headers as $header){
$size += strlen($header);
}
//Make sure the header size doesn't become more then 256kB
if($size <= 250000){
$this->response->headers->add($headers);
}
}
}

Expand Down

0 comments on commit 053633e

Please sign in to comment.