From e110f203976ffe6ff4ea7b4f578b08032301ea14 Mon Sep 17 00:00:00 2001
From: ansuz <ansuz@transitiontech.ca>
Date: Tue, 17 Jul 2018 17:41:30 +0200
Subject: [PATCH] support blocks on remote domains

---
 www/common/outer/login-block.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/www/common/outer/login-block.js b/www/common/outer/login-block.js
index 5938d4f72..ef3a38676 100644
--- a/www/common/outer/login-block.js
+++ b/www/common/outer/login-block.js
@@ -106,9 +106,8 @@ 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 (typeof(ApiConfig.httpUnsafeOrigin) !== 'undefined'?
-            ApiConfig.httpUnsafeOrigin: window.location.origin + '/')
-            + 'block/' + publicKey.slice(0, 2) + '/' +  publicKey;
+        return (ApiConfig.fileHost || window.location.origin)
+            + '/block/' + publicKey.slice(0, 2) + '/' +  publicKey;
     };
 
     Block.getBlockHash = function (keys) {