Skip to content

Commit

Permalink
Merge pull request #36043 from nextcloud/fix/36042/link-reference-les…
Browse files Browse the repository at this point in the history
…s-strict-content-type-check

Link reference provider: Improve content-type check
  • Loading branch information
PVince81 authored Jan 9, 2023
2 parents 10ab0f2 + b07addd commit 79f1c30
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 79f1c30

Please sign in to comment.