fix: validate event origin from allowedOrigins in loop

This commit is contained in:
DecentM 2018-02-14 11:04:19 +01:00
parent 1cc4cc7f21
commit aac5e12d17
No known key found for this signature in database
GPG Key ID: 6BDA2D2BC5EA5B10

View File

@ -8,11 +8,9 @@
];
const sendPostMessage = message => {
allowedOrigins.forEach(origin => {
if (origin === location.origin) {
window.postMessage(message, origin);
if (allowedOrigins.includes(location.origin)) {
window.postMessage(message, location.origin);
}
});
};
const askHandshake = () => {