Skip to content

Commit 7b1f95e

Browse files
committed
Check only stylesheet link rels rather than whitelisting other rels
1 parent 4ad140e commit 7b1f95e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/html-proofer/check/links.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ def find_fragments(html, fragment_ids)
129129
html.xpath(*xpaths)
130130
end
131131

132-
IGNORABE_REL = %(canonical alternate next prev previous icon manifest apple-touch-icon)
132+
SRI_REL_TYPES = %(stylesheet)
133133

134134
def check_sri(line, content)
135-
return if IGNORABE_REL.include?(@link.rel)
135+
return unless SRI_REL_TYPES.include?(@link.rel)
136136
if !defined?(@link.integrity) && !defined?(@link.crossorigin)
137137
add_issue("SRI and CORS not provided in: #{@link.src}", line: line, content: content)
138138
elsif !defined?(@link.integrity)

0 commit comments

Comments
 (0)