Skip to content

Commit 75eeb2d

Browse files
committed
🐛 修复sri hash大小写问题
1 parent c2eaf8a commit 75eeb2d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/app/service/resource/manager.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,14 @@ export class ResourceManager extends Manager {
345345
if (key in resource.hash) {
346346
let hex = u.hash![key];
347347
if (isBase64(hex)) {
348-
// 转换为hash进对比
348+
// 转换为hex进对比
349349
hex = base64ToHex(u.hash![key]);
350350
}
351-
// 对比普通的hash
352-
if (resource.hash[key as keyof ResourceHash] !== hex) {
351+
// 对比hex
352+
if (
353+
resource.hash[key as keyof ResourceHash].toLowerCase() !==
354+
hex.toLowerCase()
355+
) {
353356
flag = false;
354357
}
355358
}

0 commit comments

Comments
 (0)