From 76f9d3ee35411a6315d0d4f02623ec99a739a576 Mon Sep 17 00:00:00 2001 From: Donovan Preston Date: Fri, 7 Sep 2018 13:21:30 -0400 Subject: [PATCH] Ignore messages posted to onmessage that aren't data urls --- android/stores/intents.js | 3 +++ package-lock.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/android/stores/intents.js b/android/stores/intents.js index 3b8f4781..ba757eaa 100644 --- a/android/stores/intents.js +++ b/android/stores/intents.js @@ -4,6 +4,9 @@ export default function intentHandler(state, emitter) { window.addEventListener( 'message', event => { + if (typeof event.data !== 'string' || !event.data.startsWith('data:')) { + return; + } fetch(event.data) .then(res => res.blob()) .then(blob => { diff --git a/package-lock.json b/package-lock.json index b01eed1a..05f8adad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14418,7 +14418,7 @@ }, "sax": { "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=" }, "schema-utils": {