From 803f440d55fc73d59771fadc7484d5280234a5ab Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Tue, 7 Jan 2025 15:08:10 -0500 Subject: [PATCH] fix: terminal not loading in self-hosted --- src/puter-js/src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/puter-js/src/index.js b/src/puter-js/src/index.js index 8aef3eb35..452b0d561 100644 --- a/src/puter-js/src/index.js +++ b/src/puter-js/src/index.js @@ -20,6 +20,11 @@ import { XDIncomingService } from './services/XDIncoming.js'; import { NoPuterYetService } from './services/NoPuterYet.js'; import { Debug } from './modules/Debug.js'; +// TODO: This is for a safe-guard below; we should check if we can +// generalize this behavior rather than hard-coding it. +// (using defaultGUIOrigin breaks locally-hosted apps) +const PROD_ORIGIN = 'https://puter.com'; + window.puter = (function() { 'use strict'; @@ -132,7 +137,7 @@ window.puter = (function() { let hostname = location.hostname.replace(/\.$/, ''); // Create a new URL object with the URL string - const url = new URL(this.defaultGUIOrigin); + const url = new URL(PROD_ORIGIN); // Extract hostname from the URL object const gui_hostname = url.hostname;