From 2637e352b00a60cd5768fcb3dc751dcd7b5bc89f Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 15 Dec 2015 16:44:47 -0500 Subject: [PATCH] Merging PR #14 Escape the filename in the array of files. Closes #14 --- lib/service-worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service-worker.js b/lib/service-worker.js index d32bafb..267a494 100644 --- a/lib/service-worker.js +++ b/lib/service-worker.js @@ -66,7 +66,7 @@ BroccoliServiceWorker.prototype.write = function(readTree, destDir) { lines.push("var urlsToPrefetch = ["); lines.push(" '/',"); getFilesRecursively(srcDir, [ "**/*" ]).forEach(function (file, idx, array) { - lines.push(createArrayLine(" '"+file+"'", idx, array.length)); + lines.push(createArrayLine(' '+JSON.stringify(file), idx, array.length)); }); lines.push("];"); precacheURLs.forEach(function (file, idx, array) {