From 834f5a194c1bf237a65ca5ba552e635acc1155f9 Mon Sep 17 00:00:00 2001 From: Ed Lepedus Date: Thu, 4 Jul 2024 09:18:06 +0100 Subject: [PATCH] Respect LIVEBOOK_BASE_URL_PATH when checking /public assets availability (#2700) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonatan Kłosko --- assets/js/hooks/js_view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/hooks/js_view.js b/assets/js/hooks/js_view.js index e7f70bf10..8ffec257e 100644 --- a/assets/js/hooks/js_view.js +++ b/assets/js/hooks/js_view.js @@ -507,9 +507,11 @@ const JSView = { * once and the response is cached. */ function cachedPublicEndpointCheck() { + const healthUrl = window.LIVEBOOK_BASE_URL_PATH + "/public/health"; + cachedPublicEndpointCheck.promise = cachedPublicEndpointCheck.promise || - fetch("/public/health") + fetch(healthUrl) .then((response) => response.status === 200) .catch((error) => false);