[object Object]

← back to Astek Landing

Fix Safari blank /curate: creds-in-URL WebKit pages reject relative fetch — resolve all 4 API fetches via location.origin (same bug/fix as f845679 on the catalog); verified in real WebKit with creds-in-URL, 400 tiles, 0 errors

834fe7f505dc00d16df775b1ce67140eddfb6379 · 2026-07-02 10:14:15 -0700 · Steve

Files touched

Diff

commit 834fe7f505dc00d16df775b1ce67140eddfb6379
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Jul 2 10:14:15 2026 -0700

    Fix Safari blank /curate: creds-in-URL WebKit pages reject relative fetch — resolve all 4 API fetches via location.origin (same bug/fix as f845679 on the catalog); verified in real WebKit with creds-in-URL, 400 tiles, 0 errors
---
 public/curate.html | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/public/curate.html b/public/curate.html
index 4126fd7..361bbee 100644
--- a/public/curate.html
+++ b/public/curate.html
@@ -103,7 +103,7 @@ let st;
 function saveSoon(){clearTimeout(st);st=setTimeout(saveNow,700);}
 async function saveNow(){
   try{
-    const r=await fetch('/api/selection',{method:'POST',headers:{'Content-Type':'application/json'},
+    const r=await fetch(location.origin+'/api/selection',{method:'POST',headers:{'Content-Type':'application/json'},
       body:JSON.stringify({skus:[...SEL]})}).then(r=>r.json());
     $('#save').textContent=r.ok?('saved '+new Date().toLocaleTimeString()):'save failed';
   }catch{$('#save').textContent='save failed';}
@@ -145,9 +145,9 @@ $('#csv').onclick=()=>{
 };
 async function load(){
   const [pd,fc,sel]=await Promise.all([
-    fetch('/api/products').then(r=>r.json()),
-    fetch('/api/facets').then(r=>r.json()),
-    fetch('/api/selection').then(r=>r.json())]);
+    fetch(location.origin+'/api/products').then(r=>r.json()),
+    fetch(location.origin+'/api/facets').then(r=>r.json()),
+    fetch(location.origin+'/api/selection').then(r=>r.json())]);
   ALL=pd.products; ALL.forEach(p=>BY_SKU[p.dw_sku]=p);
   (sel.skus||[]).forEach(s=>SEL.add(s));
   $('#book').innerHTML='<option value="">All books</option>'+(fc.books||[]).map(([b,n])=>`<option value="${esc(b)}">${esc(b)} (${n.toLocaleString()})</option>`).join('');

← 4defe60 Add /curate — Astek -> Phillipe Romano private-label selecti  ·  back to Astek Landing  ·  internal PDP: 3-tier pricing box, Request Memo/Check Stock/G 5188092 →