Skip to content

Commit 4b9a173

Browse files
committed
MC-16450: "Whoops, our bad" when copy and paste order information url on storefront
1 parent b651a26 commit 4b9a173

File tree

2 files changed

+5
-4
lines changed
  • app/code/Magento/Sales/Controller/Guest
  • dev/tests/integration/testsuite/Magento/Sales/Controller/Guest

2 files changed

+5
-4
lines changed

app/code/Magento/Sales/Controller/Guest/View.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Sales\Controller\Guest;
77

88
use Magento\Framework\App\Action;
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Sales\Helper\Guest as GuestHelper;
1011
use Magento\Framework\View\Result\PageFactory;
1112
use Magento\Framework\Controller\ResultInterface;
@@ -14,7 +15,7 @@
1415
/**
1516
* Guest order view action.
1617
*/
17-
class View extends Action\Action implements HttpPostActionInterface
18+
class View extends Action\Action implements HttpPostActionInterface, HttpGetActionInterface
1819
{
1920
/**
2021
* @var \Magento\Sales\Helper\Guest

dev/tests/integration/testsuite/Magento/Sales/Controller/Guest/ViewTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
class ViewTest extends AbstractController
1717
{
1818
/**
19-
* Check that controller applied only POST requests.
19+
* Check that controller applied GET requests.
2020
*/
21-
public function testExecuteWithNonPostRequest()
21+
public function testExecuteWithGetRequest()
2222
{
2323
$this->getRequest()->setMethod(Request::METHOD_GET);
2424
$this->dispatch('sales/guest/view/');
2525

26-
$this->assert404NotFound();
26+
$this->assertRedirect($this->stringContains('sales/guest/form'));
2727
}
2828
}

0 commit comments

Comments
 (0)