Bug #84098
closed403 forbidden error on trying to access 404 page
100%
Description
I have a system with the following pagenotfound configurations.
'pageNotFoundOnCHashError' => '0',
'pageNotFound_handling' => '/404',
'pageNotFound_handling_statheader' => 'HTTP/1.0 404 Not Found',
But on having an invalid url ,it fails to redirect to the 404 error page and instead throws the following exception.
Uncaught TYPO3 Exception #1509296606: Failed to fetch error page "https://example.dev/404", reason: Client error: `GET http://example.dev/404` resulted in a `403 Forbidden` response: <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <!-- This website is powered by TYPO3 - inspiring people (truncated...) (More information) RuntimeException thrown in file /var/www/example/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php in line 2053. 17 TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::pageErrorHandler("http://example.dev/404", "HTTP/1.0 404 Not Found", "Segment "testurl" was not a keyword for a postVarSet as expected on page with id=4.").
On debugging i found that there is a report generation for http requests from typo3 8.7.9 onwards which the following line of code(/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php) indicates.
$report = [];
$res = GeneralUtility::getUrl($code, 1, $headerArr, $report);
if ((int)$report['error'] !== 0 && (int)$report['error'] !== 200) {
throw new \RuntimeException('Failed to fetch error page "' . $code . '", reason: ' . $report['message'], 1509296606);
}
on commenting out statements inside the 'if' condition, everything works fine.I wonder if there is any need for these additional line of code(which wasn't there in Typo3 8.7.8) as it directly throwing out an exception instead of writing it into a log.
Can you guys give any further insight on this?.Thanks in advance.