mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Merge pull request #1760 from matrix-org/matthew/improve-postmessage-origin-check2
improve origin check of ScalarMessaging postmessage API.
This commit is contained in:
commit
715198dc17
@ -563,7 +563,7 @@ const onMessage = function(event) {
|
||||
const url = SdkConfig.get().integrations_ui_url;
|
||||
if (
|
||||
event.origin.length === 0 ||
|
||||
!url.startsWith(event.origin) ||
|
||||
!url.startsWith(event.origin + '/') ||
|
||||
!event.data.action ||
|
||||
event.data.api // Ignore messages with specific API set
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user