From f6f90712af9e7d7358de9db3d92704f6f3fb8471 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 19 Mar 2021 15:20:33 +0530 Subject: [PATCH] stricter tests for the sandbox checkup --- www/checkup/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/www/checkup/main.js b/www/checkup/main.js index bcbdf0d7b..5dcd1e8cf 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -42,12 +42,13 @@ define([ return void cb(trimmedSafe !== trimmedUnsafe); }, _alert('Sandbox configuration: httpUnsafeOrigin !== httpSafeOrigin')); + assert(function (cb) { + cb(trimmedSafe === ApiConfig.httpSafeOrigin); + }, "httpSafeOrigin must not have a trailing slash"); + assert(function (cb) { var origin = window.location.origin; - return void cb([ - origin, - origin + '/' - ].indexOf(ApiConfig.httpUnsafeOrigin) !== -1); + return void cb(ApiConfig.httpUnsafeOrigin === origin); }, _alert('Sandbox configuration: loading via httpUnsafeOrigin'));