LibWeb: Fix SRI handling of badly-formatted strings

(cherry picked from commit 39dae6fb2db58156dda7c58cb5293ca52ff35d4e)
This commit is contained in:
Lyra authored and Nico Weber committed 2026-09-21 20:55:55 -04:00
1 parent ce1809234d
commit 89a4815969
3 files changed
+18 -1

No files matched your search

@@ -0,0 +1 @@
.body {}
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link
href="invalid-integrity-attribute.css"
type="text/css"
rel="stylesheet"
crossorigin="anonymous"
integrity="051df3b15e50dd8711b1fa2f4e11f69060b4d77e0a3950a5ae2dc9f5c6bf8a37"
nonce=""
>
<title>Test</title>
</head>
<body>
+1 -1
View File
@@ -90,7 +90,7 @@ ErrorOr<Vector<Metadata>> parse_metadata(StringView metadata)
auto algorithm = hash_expr_token_list[0];
// 6. If hash-expr-token-list[1] exists, set base64-value to hash-expr-token-list[1].
if (hash_expr_token_list.size() >= 1)
if (hash_expr_token_list.size() > 1)
base64_value = hash_expr_token_list[1];
// 7. If algorithm is not a hash function recognized by the user agent, continue.