Skip to content

Commit

Permalink
Magento 2.3.2 compatibility for Push callback
Browse files Browse the repository at this point in the history
  • Loading branch information
albtje committed Aug 21, 2019
1 parent 50fe89e commit 8274e55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Controller/Index/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ public function __construct(

parent::__construct($context);

// Fix for Magento2.3 adding isAjax to the request params
// Magento 2.3 post request compatibility
if (interface_exists('\Magento\Framework\App\CsrfAwareActionInterface')) {
$request = $this->getRequest();
if ($request instanceof HttpRequest && $request->isPost()) {
$request->setParam('isAjax', true);
$request->getHeaders()->addHeaderLine('X_REQUESTED_WITH', 'XMLHttpRequest');
}
}
}
Expand Down

0 comments on commit 8274e55

Please sign in to comment.