Skip to content

Commit 19ee175

Browse files
vtenfysGatsbyJS Bot
authored and
GatsbyJS Bot
committed
fix(gatsby-plugin-offline): prevent caching invalid relative paths (#17406)
1 parent 49bf3f8 commit 19ee175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/gatsby-plugin-offline/src/get-resources-from-html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = (htmlPath, pathPrefix) => {
4343

4444
// check resource URLs from header tags start with the correct prefix
4545
// (these are not page URLs)
46-
if (!blackListRegex.test(url) && url.startsWith(pathPrefix)) {
46+
if (!blackListRegex.test(url) && url.startsWith(`${pathPrefix}/`)) {
4747
criticalFilePaths.push(url.replace(/^\//, ``))
4848
}
4949
})

0 commit comments

Comments
 (0)