fix: CSS MIME type mapping in server.mjs + rename blog hero header to section
E2E Test Suite / Smoke Tests (P0) (push) Has been cancelled
E2E Test Suite / Critical User Journeys (push) Has been cancelled
E2E Test Suite / API Integration Tests (push) Has been cancelled
E2E Test Suite / Form Interaction Tests (push) Has been cancelled
E2E Test Suite / Destructive & Chaos Tests (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (chromium) (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (firefox) (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (webkit) (push) Has been cancelled
E2E Test Suite / Mobile Device Tests (push) Has been cancelled
E2E Test Suite / Security Header Tests (push) Has been cancelled
E2E Test Suite / Test Report Summary (push) Has been cancelled
Ping Search Engines / Notify Search Engines (push) Successful in 3s
Deploy to Production / Pre-Deploy Tests (push) Has been skipped
Deploy to Production / Build & Verify (push) Failing after 6m1s
Deploy to Production / Deploy to Railway (push) Has been skipped
Deploy to Production / Deploy to Render (push) Has been skipped
Deploy to Production / Deploy to VPS (PM2) (push) Has been skipped
Deploy to Production / Deploy to Fly.io (push) Has been skipped
Deploy to Production / Post-Deploy Verification (push) Has been skipped
Deploy to Production / Notify on Failure (push) Has been cancelled
E2E Test Suite / Smoke Tests (P0) (push) Has been cancelled
E2E Test Suite / Critical User Journeys (push) Has been cancelled
E2E Test Suite / API Integration Tests (push) Has been cancelled
E2E Test Suite / Form Interaction Tests (push) Has been cancelled
E2E Test Suite / Destructive & Chaos Tests (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (chromium) (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (firefox) (push) Has been cancelled
E2E Test Suite / Cross-Browser Regression (webkit) (push) Has been cancelled
E2E Test Suite / Mobile Device Tests (push) Has been cancelled
E2E Test Suite / Security Header Tests (push) Has been cancelled
E2E Test Suite / Test Report Summary (push) Has been cancelled
Ping Search Engines / Notify Search Engines (push) Successful in 3s
Deploy to Production / Pre-Deploy Tests (push) Has been skipped
Deploy to Production / Build & Verify (push) Failing after 6m1s
Deploy to Production / Deploy to Railway (push) Has been skipped
Deploy to Production / Deploy to Render (push) Has been skipped
Deploy to Production / Deploy to VPS (PM2) (push) Has been skipped
Deploy to Production / Deploy to Fly.io (push) Has been skipped
Deploy to Production / Post-Deploy Verification (push) Has been skipped
Deploy to Production / Notify on Failure (push) Has been cancelled
- Add explicit mimeTypes map and setHeaders callback to the /_assets express.static handler to guarantee correct Content-Type for .css, .js, .mjs, .json, .svg, .png, .jpg, .webp, and .woff2 files - Rename the blog post hero <header> to <section> to eliminate duplicate <header> elements and fix Playwright strict-mode selector failures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2d76e24e25
commit
47c7256c35
+19
@@ -32,6 +32,19 @@ app.use(compression({
|
||||
},
|
||||
}));
|
||||
|
||||
// MIME type map for explicit Content-Type headers
|
||||
const mimeTypes = {
|
||||
'.css': 'text/css',
|
||||
'.js': 'application/javascript',
|
||||
'.mjs': 'application/javascript',
|
||||
'.json': 'application/json',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.png': 'image/png',
|
||||
'.jpg': 'image/jpeg',
|
||||
'.webp': 'image/webp',
|
||||
'.woff2': 'font/woff2',
|
||||
};
|
||||
|
||||
// Serve static assets with long-term caching
|
||||
// Hashed assets (_assets/) get 1-year immutable cache
|
||||
// Non-hashed assets get 1-hour cache with revalidation
|
||||
@@ -39,6 +52,12 @@ app.use('/_assets', express.static(join(__dirname, 'dist', 'client', '_assets'),
|
||||
maxAge: '1y',
|
||||
immutable: true,
|
||||
etag: false,
|
||||
setHeaders: (res, filePath) => {
|
||||
const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();
|
||||
if (mimeTypes[ext]) {
|
||||
res.setHeader('Content-Type', mimeTypes[ext]);
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
app.use(express.static(join(__dirname, 'dist', 'client'), {
|
||||
|
||||
Reference in New Issue
Block a user