We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[vulnerability] HTML/SVG responses with irregular extensions are not hooked
diff --git a/lib/service-worker.js b/lib/service-worker.js index 21074c79..899609bb 100644 --- a/lib/service-worker.js +++ b/lib/service-worker.js @@ -288,8 +288,8 @@ module.exports = function (hook, preprocess) { } }); } - else if (url.pathname.match(/(\/|[.]html?|[.]svg)$/)) { - let isSVG = url.pathname.match(/([.]svg)$/); + else if (url.pathname.match(/(\/|[.]html?|[.]svg)$/) || response.headers.get('content-type').match(/^text\/html|image\/svg\+xml/)) { + let isSVG = url.pathname.match(/([.]svg)$/) || response.headers.get('content-type').match(/^image\/svg\+xml/); let original; let decoded; let contextGeneratorScripts = [];
The text was updated successfully, but these errors were encountered:
0.3.4 with [vulnerability] Fix #314 Detect HTML/SVG with content-type…
3804de9
… as well as extensions
35f6f26
No branches or pull requests
[vulnerability] HTML/SVG responses with irregular extensions are not hooked
Root Causes
Fix
The text was updated successfully, but these errors were encountered: