Respect LIVEBOOK_BASE_URL_PATH when checking /public assets availability (#2700)

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
This commit is contained in:
Ed Lepedus 2024-07-04 09:18:06 +01:00 committed by GitHub
parent 066a364123
commit 834f5a194c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);