in the link reference provider, check if the link content type begins with text/html

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
Julien Veyssier 2023-01-09 11:08:56 +01:00
parent ff0a32f70f
commit b07adddf39
No known key found for this signature in database
GPG key ID: 4141FEE162030638

View file

@ -116,7 +116,9 @@ class LinkReferenceProvider implements IReferenceProvider {
return;
}
$linkContentType = $headResponse->getHeader('Content-Type');
if ($linkContentType !== 'text/html') {
$expectedContentType = 'text/html';
// check the header begins with the expected content type
if (substr($linkContentType, 0, strlen($expectedContentType)) !== $expectedContentType) {
$this->logger->debug('Skip resolving links pointing to content type that is not "text/html"');
return;
}