summaryrefslogtreecommitdiff
path: root/src/client/rz_api_backend.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-04-25 16:57:10 +0300
committerAlon Levy <alon@pobox.com>2015-04-25 21:05:19 +0300
commitaafae6f846f533cedc4eab1857aab97395a0be31 (patch)
tree6bf855e30da3ea0976b9ce3a4786714c047890be /src/client/rz_api_backend.js
parent0a20324e01210b6654c5f4415efd53d44c2c5246 (diff)
client: drop rz_server_{host,port}, use document.location
Since the client can be hidden from the server via multiple layers, be they load balancers, proxies or iptable rules, it is simpler to not have the server aware of those layers and have to inform the client of them, instead use information the client already has.
Diffstat (limited to 'src/client/rz_api_backend.js')
-rw-r--r--src/client/rz_api_backend.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/client/rz_api_backend.js b/src/client/rz_api_backend.js
index 416e9708..9401e6f1 100644
--- a/src/client/rz_api_backend.js
+++ b/src/client/rz_api_backend.js
@@ -7,10 +7,7 @@ define(['util', 'model/core'], function(util, model_core) {
function RZ_API_Backend() {
- var rz_server_url = 'http://%h:%p';
- rz_server_url = rz_server_url.replace('%h', rz_config.rz_server_host);
- rz_server_url = rz_server_url.replace('%p', rz_config.rz_server_port);
-
+ var rz_server_url = document.location.origin;
var common_req_ctx = function() {
var common_ctx = { rzdoc_name: rz_config.rzdoc_cur__name }; // FIXME: call rz_core.rzdoc_get_current + avoid requirejs circular dep