Skip to content

Commit b97e2bc

Browse files
committed
ACP2E-3343: Critical 500 Error: Magento\Framework\Webapi\Exception Related to Accept HTTP Header
1 parent 306dab3 commit b97e2bc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
1919
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2020
* @magentoAppArea frontend
21+
* @magentoAppIsolation enabled
2122
*/
2223
class FrontControllerTest extends TestCase
2324
{
@@ -118,4 +119,24 @@ public function testInvalidRequest()
118119
$this->_model->dispatch($request)
119120
);
120121
}
122+
123+
public function testDispatchWithAcceptHeader(): void
124+
{
125+
if (!Bootstrap::canTestHeaders()) {
126+
$this->markTestSkipped('Can\'t test dispatch process without sending headers');
127+
}
128+
129+
$this->fakeRequestValidator->valid = true;
130+
$_SERVER['HTTP_HOST'] = 'localhost';
131+
$this->_objectManager->get(State::class)->setAreaCode('frontend');
132+
$request = $this->_objectManager->get(HttpRequest::class);
133+
$request->setRequestUri('/checkout');
134+
$headers = $request->getHeaders();
135+
$headers->addHeaderLine('Accept', 'text/html');
136+
$request->setHeaders($headers);
137+
$this->assertInstanceOf(
138+
ResultInterface::class,
139+
$this->_model->dispatch($request)
140+
);
141+
}
121142
}

0 commit comments

Comments
 (0)