Skip to content

Commit 0a0d65e

Browse files
committed
MUI controller lacks JSON return, instead returns status 200 with empty body
1 parent b1d3061 commit 0a0d65e

File tree

1 file changed

+12
-0
lines changed
  • app/code/Magento/Ui/Controller/Adminhtml/Index

1 file changed

+12
-0
lines changed

app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ public function execute()
8686

8787
$contentType = $this->contentTypeResolver->resolve($component->getContext());
8888
$this->getResponse()->setHeader('Content-Type', $contentType, true);
89+
}else {
90+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
91+
$resultJson = $this->resultJsonFactory->create();
92+
$resultJson->setStatusHeader(
93+
\Zend\Http\Response::STATUS_CODE_403,
94+
\Zend\Http\AbstractMessage::VERSION_11,
95+
'Forbidden'
96+
);
97+
return $resultJson->setData([
98+
'error' => $this->escaper->escapeHtml('Forbidden'),
99+
'errorcode' => 403]
100+
);
89101
}
90102
} catch (\Magento\Framework\Exception\LocalizedException $e) {
91103
$this->logger->critical($e);

0 commit comments

Comments
 (0)