From bcbec0144c9dad8293f7e6e6422c272ab1a0a70d Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 17 Jul 2018 16:20:40 +0200 Subject: [PATCH] provide a default in case httpUnsafeOrigin is not provided --- www/common/outer/login-block.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/outer/login-block.js b/www/common/outer/login-block.js index 341a2e7d1..4916ffa27 100644 --- a/www/common/outer/login-block.js +++ b/www/common/outer/login-block.js @@ -106,7 +106,9 @@ define([ // 'block/' here is hardcoded because it's hardcoded on the server // if we want to make CryptPad work in server subfolders, we'll need // to update this path derivation - return ApiConfig.httpUnsafeOrigin + 'block/' + publicKey.slice(0, 2) + '/' + publicKey; + return (typeof(ApiConfig.httpUnsafeOrigin) !== 'undefined'? + ApiConfig.httpUnsafeOrigin: window.location.origin) + + 'block/' + publicKey.slice(0, 2) + '/' + publicKey; }; Block.getBlockHash = function (keys) {