From ace46503beb88fb3ca3067dbc291bee73d8e7583 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 29 Jun 2021 22:17:14 -0400 Subject: Make Display.authenticateMessageData private (#1780) --- ext/js/display/display.js | 24 ++++++++++++------------ 1 file 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; } -- cgit v1.2.3