stricter tests for the sandbox checkup

pull/1/head
ansuz 4 years ago
parent b4adf0ac4a
commit f6f90712af

@ -42,12 +42,13 @@ define([
return void cb(trimmedSafe !== trimmedUnsafe); return void cb(trimmedSafe !== trimmedUnsafe);
}, _alert('Sandbox configuration: httpUnsafeOrigin !== httpSafeOrigin')); }, _alert('Sandbox configuration: httpUnsafeOrigin !== httpSafeOrigin'));
assert(function (cb) {
cb(trimmedSafe === ApiConfig.httpSafeOrigin);
}, "httpSafeOrigin must not have a trailing slash");
assert(function (cb) { assert(function (cb) {
var origin = window.location.origin; var origin = window.location.origin;
return void cb([ return void cb(ApiConfig.httpUnsafeOrigin === origin);
origin,
origin + '/'
].indexOf(ApiConfig.httpUnsafeOrigin) !== -1);
}, _alert('Sandbox configuration: loading via httpUnsafeOrigin')); }, _alert('Sandbox configuration: loading via httpUnsafeOrigin'));

Loading…
Cancel
Save