Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(integrity): use new sri.match() for verification
Browse files Browse the repository at this point in the history
This should fix some more integrity warnings
  • Loading branch information
zkat committed Apr 12, 2018
1 parent 39c3339 commit 4f371a0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,7 @@ function matchDetails (req, cached) {
}
}
if (cached.integrity) {
const cachedSri = ssri.parse(cached.cacheIntegrity)
const sri = ssri.parse(cached.integrity)
const algo = sri.pickAlgorithm()
if (cachedSri[algo] && !sri[algo].some(hash => {
// cachedSri always has exactly one item per algorithm
return cachedSri[algo][0].digest === hash.digest
})) {
return false
}
return ssri.parse(cached.integrity).match(cached.cacheIntegrity)
}
reqUrl.hash = null
cacheUrl.hash = null
Expand Down

0 comments on commit 4f371a0

Please sign in to comment.