stricter tests for the sandbox checkup

pull/1/head
ansuz 2021-03-19 15:20:33 +05:30
parent b4adf0ac4a
commit f6f90712af
1 changed files with 5 additions and 4 deletions

View File

@ -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'));