← back to Wallpaperdictionary
harden static root: 404-guard .bak/.pre- paths, ignore snapshot files
74d844f23fea11c1355c01716e5bc3cd27eff4ee · 2026-05-19 08:09:29 -0700 · SteveStudio2
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Files touched
M .gitignoreM public/index.htmlM server.js
Diff
commit 74d844f23fea11c1355c01716e5bc3cd27eff4ee
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date: Tue May 19 08:09:29 2026 -0700
harden static root: 404-guard .bak/.pre- paths, ignore snapshot files
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
.gitignore | 3 +++
public/index.html | 4 ++--
server.js | 8 ++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index 08240ae..bfd17aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,6 @@ tmp/
.DS_Store
dist/
build/
+*.bak
+*.bak.*
+*.pre-*
diff --git a/public/index.html b/public/index.html
index 24f6562..0dca118 100644
--- a/public/index.html
+++ b/public/index.html
@@ -304,7 +304,7 @@ body {
<nav class="header-nav">
<a href="#dictionary">A–Z Terms</a>
<a href="#cta">Browse Catalog</a>
- <a href="https://designerwallcoverings.com" target="_blank">DW</a>
+ <a href="https://designerwallcoverings.com" target="_blank" rel="noopener noreferrer">DW</a>
</nav>
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark/light mode">
<svg id="iconSun" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display:none"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>
@@ -750,7 +750,7 @@ body {
<div class="cta-section">
<h2>Browse 8,000+ wallcoverings with free memo samples</h2>
<p>Designer Wallcoverings carries the industry's deepest selection — from hand-printed grasscloth to digital murals to Type II commercial vinyl. Order a free memo sample and let our trade specialists help you specify the right product for your project.</p>
- <a href="https://designerwallcoverings.com" target="_blank" class="cta-btn">Explore the Full Catalog</a>
+ <a href="https://designerwallcoverings.com" target="_blank" rel="noopener noreferrer" class="cta-btn">Explore the Full Catalog</a>
</div>
</section>
diff --git a/server.js b/server.js
index 6cf9733..738d7e4 100644
--- a/server.js
+++ b/server.js
@@ -3,6 +3,14 @@ const path = require('path');
const app = express();
const PORT = process.env.PORT || 9900;
+// Never serve snapshot/backup files from static root
+app.use((req, res, next) => {
+ if (/(\.bak(\..*)?|\.pre-)/i.test(req.path)) {
+ return res.status(404).type('txt').send('Not Found');
+ }
+ next();
+});
+
app.use(express.static(path.join(__dirname, 'public')));
app.get('/health', (req, res) => res.json({ status: 'ok', site: 'wallpaperdictionary.com' }));
← 4399524 embed Big Red customer chat (lower-left, retail mode, vendor
·
back to Wallpaperdictionary
·
add corner-nav.js — universal top-right nav per _shared/corn 15e0b5f →