Skip to content

Commit ff7b78e

Browse files
authored
Merge pull request #34 from mageho/patch-1
Missing crossorigin in html output
2 parents 15397c9 + 9c4da7c commit ff7b78e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Link/LinkParser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ private function processBody(HttpResponse $response)
110110
continue;
111111
}
112112

113-
$newTags[] = '<link rel="preload" as="' . $link->getType() . '" href="' . $link->getUrl() . '" />';
113+
$createTag = '<link rel="preload" as="' . $link->getType() . '"';
114+
if ($link->getType() === 'font') {
115+
$createTag .= ' crossorigin="anonymous"';
116+
}
117+
$createTag .= ' href="' . $link->getUrl() . '" />';
118+
119+
$newTags[] = $createTag;
114120
}
115121

116122
$body = preg_replace('^</title>^',"</title>\n" . implode("\n", $newTags) , $body, 1);

0 commit comments

Comments
 (0)