← back to Wallpapercanada
fix: safeImg allow same-origin /img/ proxy urls (vendor-neutral image proxy 2026-06-03) — product cards were falling back to hero-bg (images all wrong)
0e0c8b68dae1f8214bf57568217da90e5145faab · 2026-06-18 09:04:30 -0700 · Steve Abrams
Files touched
Diff
commit 0e0c8b68dae1f8214bf57568217da90e5145faab
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Jun 18 09:04:30 2026 -0700
fix: safeImg allow same-origin /img/ proxy urls (vendor-neutral image proxy 2026-06-03) — product cards were falling back to hero-bg (images all wrong)
---
public/index.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/public/index.html b/public/index.html
index 82c04c3..103212a 100644
--- a/public/index.html
+++ b/public/index.html
@@ -720,8 +720,10 @@ function cleanSku(s){
var V=/(?:^|-)(versace|kravet|fentucci|sandberg|harlequin|blithfield|westport|thibaut|koroseal|schumacher|scalamandre|fromental|dedar|carnegie|marburg|fabricut|coordonne|nina-campbell|lee-jofa(?:-modern)?|clarke(?:-and)?-clarke|clarke|brunschwig(?:-and)?(?:-fils)?|designers-guild|graham-(?:and-)?brown|andrew-martin|candice-olson|ronald-redding|jeffrey-stevens|sister-parish|arte-international|wolf-gordon|phillip-jeffries|cole-(?:and-)?son|maya-romanoff|g-p-j-baker|les-ensembliers|breegan(?:-jane)?)(?:-\\d+)?(?=-|$)/gi;
return String(s||'').replace(V,'').replace(/--+/g,'-').replace(/^-+|-+$/g,'');
}
-// Image-URL allowlist: only DW Shopify CDN + designerwallcoverings.com (defends against XSS via crafted products.json)
-function safeImg(u) { return /^https:\/\/(?:cdn\.shopify\.com|designerwallcoverings\.com)\//.test(u || '') ? u : '/hero-bg.jpg'; }
+// Image-URL allowlist: same-origin proxied /img/ (vendor-neutral image proxy, 2026-06-03) +
+// DW Shopify CDN + designerwallcoverings.com (defends against XSS via crafted products.json).
+// /img/ is server-controlled same-origin (not protocol-relative, not a javascript: URI) so it's safe.
+function safeImg(u) { u = u || ''; return (/^\/img\//.test(u) || /^https:\/\/(?:cdn\.shopify\.com|designerwallcoverings\.com)\//.test(u)) ? u : '/hero-bg.jpg'; }
// USD → CAD conversion (cosmetic; final price confirmed at checkout)
const USD_CAD = 1.36;
function cadPrice(usd) {
← 713d1d9 Recompute aesthetic from tags via classifyAesthetic (was deg
·
back to Wallpapercanada
·
Mount new-arrivals promo strip (Tier B): require ../_shared/ c3879e4 →