[object Object]

← back to Jutewallpaper

wire api-vendor-redact middleware + scrub p.vendor from rail-card render

9191fe7619ddc7f2e35d9f7ac8ddbc19fe030441 · 2026-05-25 21:15:35 -0700 · Steve Abrams

- mount _shared/api-vendor-redact before /api/* routes so /api/facets stops
  emitting vendors map and /api/products stops accepting ?vendor= filter
- replace p.vendor literal in hydrateIdeas rail-card with 'Designer Wallcoverings'
  to match the rest of the storefront (defense-in-depth alongside the middleware)

Files touched

Diff

commit 9191fe7619ddc7f2e35d9f7ac8ddbc19fe030441
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 25 21:15:35 2026 -0700

    wire api-vendor-redact middleware + scrub p.vendor from rail-card render
    
    - mount _shared/api-vendor-redact before /api/* routes so /api/facets stops
      emitting vendors map and /api/products stops accepting ?vendor= filter
    - replace p.vendor literal in hydrateIdeas rail-card with 'Designer Wallcoverings'
      to match the rest of the storefront (defense-in-depth alongside the middleware)
---
 public/index.html | 2 +-
 server.js         | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/public/index.html b/public/index.html
index 48571f9..540a5fc 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1079,7 +1079,7 @@ loadGridPage();
       return '<a class="rail-card" href="/sample/' + encodeURIComponent(p.handle || p.sku) + '">' +
         '<img src="' + url + '" alt="' + (p.title || '').replace(/"/g, '&quot;') + '" loading="lazy">' +
         '<div class="rc-title">' + ((p.title || '').split('|')[0] || '').trim() + '</div>' +
-        '<div class="rc-meta">' + (p.vendor || '') + '</div>' +
+        '<div class="rc-meta">Designer Wallcoverings</div>' +
       '</a>';
     }
     const r1 = document.getElementById('railNewest');
diff --git a/server.js b/server.js
index 2469b31..435d16f 100644
--- a/server.js
+++ b/server.js
@@ -140,6 +140,9 @@ function sortProducts(list, mode) {
 
 app.use(helmet({ contentSecurityPolicy: false }));
 app.use(express.json({ limit: '256kb' }));
+// Fleet-wide DW vendor-name redactor on /api/* (drops `vendors` facet, replaces
+// any `vendor` field with "Designer Wallcoverings", strips `?vendor=` query).
+app.use(require('../_shared/api-vendor-redact'));
 // Universal contact module — modals, /api/send-inquiry, /api/send-sample, /zd-loader.js
 require('./_universal-contact')(app, { siteName: "Jute Wallpaper", zdColor: "#c89858", zdPosition: 'right' });
 require('./_universal-auth')(app, { siteName: "jutewallpaper" });

← 2c844cb retag aesthetic from PG: 59 rows updated  ·  back to Jutewallpaper  ·  hydrate sort from localStorage pre-grid-load + noreferrer on 4e2dc09 →