Skip to content

Commit

Permalink
Safer Header Check
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jul 23, 2019
1 parent 34a6374 commit 95717f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class Response extends \Symfony\Component\HttpFoundation\Response
{
protected $_callTime;
protected $_headersSent = false;
protected $_sendDebugHeaders;

/**
Expand Down Expand Up @@ -58,8 +59,13 @@ public function setCallStartTime($time)
*/
public function sendHeaders()
{
$this->setDebugHeaders();
return parent::sendHeaders();
if(!$this->_headersSent)
{
$this->_headersSent = true;
$this->setDebugHeaders();
return parent::sendHeaders();
}
return $this;
}

/**
Expand Down

0 comments on commit 95717f7

Please sign in to comment.