Skip to content

Commit 0ac7c8d

Browse files
Github issue 34380: Restricted controller to handle only POST requests.
1 parent 9439018 commit 0ac7c8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ public function __construct(
6262

6363
/**
6464
* @return $this
65+
* @throws LocalizedException
6566
*/
6667
public function execute()
6768
{
69+
if (!$this->getRequest()->isPost()) {
70+
throw new LocalizedException(__('Wrong request.'));
71+
}
72+
6873
$itemId = (int)$this->getRequest()->getParam('item_id');
6974
$itemQty = (float)$this->getRequest()->getParam('item_qty') * 1;
7075
$itemQty = $this->quantityProcessor->prepareQuantity($itemQty);

0 commit comments

Comments
 (0)