fix: validate event origin from allowedOrigins in loop
This commit is contained in:
parent
1cc4cc7f21
commit
aac5e12d17
|
@ -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 = () => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user