From c2b5820f8a2f203ac00059504c6f5fd71d80eb23 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 24 Mar 2026 10:41:13 -0700 Subject: [PATCH] fix(rdesign): use relative path for API fetch to avoid mixed content The bare-domain router redirects /demo/... paths to demo.rspace.online with http:// protocol, causing mixed content errors. Use the current page path as the base URL instead of constructing an absolute path. Co-Authored-By: Claude Opus 4.6 --- modules/rdesign/mod.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/rdesign/mod.ts b/modules/rdesign/mod.ts index 42ef831..2826787 100644 --- a/modules/rdesign/mod.ts +++ b/modules/rdesign/mod.ts @@ -215,7 +215,8 @@ const RDESIGN_JS = ` var space = document.getElementById('rdesign-app').dataset.space || 'demo'; var fetchHeaders = { 'Content-Type': 'application/json' }; try { var sess = JSON.parse(localStorage.getItem('encryptid_session') || '{}'); if (sess.accessToken) fetchHeaders['Authorization'] = 'Bearer ' + sess.accessToken; } catch(e) {} - fetch('/' + space + '/rdesign/api/design-agent', { + var basePath = window.location.pathname.replace(/\\/$/, ''); + fetch(basePath + '/api/design-agent', { method: 'POST', headers: fetchHeaders, body: JSON.stringify({ brief: text, space: space }),