Linkvalidator wrongly handles Guzzle exceptions for 40x status
The linkvalidator tries to use HEAD requests to test URLs for external-type links. As this method may not be allowed, it falls back to GET.
This mechanism is broken since TYPO3 8, with the introduction of Guzzle, as Guzzle does not return a proper response with a status code in case of 40x errors. Instead it throws an exception, with the HTTP status code used as exception code.
\TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype class needs to be adapted accordingly.
Updated by Sybille Peters almost 6 years ago
- Status changed from Resolved to New
- Assignee set to Sybille Peters
It seems this was not entirely resolved. The patch correctly handles the Guzzle exception but the behaviour should be:
If HEAD fails, try GET.
What it does do currently: if HEAD fails (Exception is thrown) and Link is marked as broken.
Steps to reproduce¶
Create a link to a target with working link which will fail on HEAD, e.g.: https://www.retraitequebec.gouv.qc.ca/fr/Pages/accueil.aspx