Skip to content

Commit

Permalink
in the link reference provider, check if the link content type begins…
Browse files Browse the repository at this point in the history
… with text/html

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
  • Loading branch information
julien-nc committed Jan 9, 2023
1 parent ff0a32f commit b07addd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ private function fetchReference(Reference $reference): void {
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;
}
Expand Down

0 comments on commit b07addd

Please sign in to comment.