diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-29 22:17:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 22:17:14 -0400 |
commit | ace46503beb88fb3ca3067dbc291bee73d8e7583 (patch) | |
tree | 47dd22e4cfb9e17fa2712e84395437efc8e7d816 | |
parent | deb2a742edf2ddc741d71fa8a95471cbd4663a4a (diff) |
Make Display.authenticateMessageData private (#1780)
-rw-r--r-- | ext/js/display/display.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 4148cd84..7ede1384 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -380,16 +380,6 @@ class Display extends EventDispatcher { } } - authenticateMessageData(data) { - if (this._frameEndpoint === null) { - return data; - } - if (!this._frameEndpoint.authenticate(data)) { - throw new Error('Invalid authentication'); - } - return data.data; - } - setQueryPostProcessor(func) { this._queryPostProcessor = func; } @@ -454,7 +444,7 @@ class Display extends EventDispatcher { // Message handlers _onDirectMessage(data) { - data = this.authenticateMessageData(data); + data = this._authenticateMessageData(data); const {action, params} = data; const handlerInfo = this._directMessageHandlers.get(action); if (typeof handlerInfo === 'undefined') { @@ -468,7 +458,7 @@ class Display extends EventDispatcher { _onWindowMessage({data}) { try { - data = this.authenticateMessageData(data); + data = this._authenticateMessageData(data); } catch (e) { return; } @@ -518,6 +508,16 @@ class Display extends EventDispatcher { // Private + _authenticateMessageData(data) { + if (this._frameEndpoint === null) { + return data; + } + if (!this._frameEndpoint.authenticate(data)) { + throw new Error('Invalid authentication'); + } + return data.data; + } + async _onStateChanged() { if (this._historyChangeIgnore) { return; } |