Skip to content

Commit

Permalink
Avoid duplicate headers error by checking whether there is a body and…
Browse files Browse the repository at this point in the history
… only proceeding if there is.
  • Loading branch information
bobbyshaw committed Aug 22, 2015
1 parent 4e1c0e1 commit 3dbb366
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/code/community/Meanbee/Footerjs/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function handleInlineJs(Varien_Event_Observer $observer)
/** @var Mage_Core_Controller_Response_Http $response */
$response = $observer->getResponse();

if (!$response->getBody()) {
// No further action if no body, e.g. redirect
return $this;
}

$patterns = array(
'js' => self::REGEX_JS,
'document_end' => self::REGEX_DOCUMENT_END
Expand Down

0 comments on commit 3dbb366

Please sign in to comment.