Merge pull request #920 from mozilla/ignore-non-data-urls

Ignore messages posted to onmessage that aren't data urls
This commit is contained in:
Danny Coates 2018-09-07 10:32:22 -07:00 committed by GitHub
commit a8b305a84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,9 @@ export default function intentHandler(state, emitter) {
window.addEventListener( window.addEventListener(
'message', 'message',
event => { event => {
if (typeof event.data !== 'string' || !event.data.startsWith('data:')) {
return;
}
fetch(event.data) fetch(event.data)
.then(res => res.blob()) .then(res => res.blob())
.then(blob => { .then(blob => {

2
package-lock.json generated
View File

@ -14418,7 +14418,7 @@
}, },
"sax": { "sax": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "http://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
}, },
"schema-utils": { "schema-utils": {