aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-06-29 22:17:14 -0400
committerGitHub <noreply@github.com>2021-06-29 22:17:14 -0400
commitace46503beb88fb3ca3067dbc291bee73d8e7583 (patch)
tree47dd22e4cfb9e17fa2712e84395437efc8e7d816
parentdeb2a742edf2ddc741d71fa8a95471cbd4663a4a (diff)
Make Display.authenticateMessageData private (#1780)
-rw-r--r--ext/js/display/display.js24
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; }