[object Object]

← back to Stars of Design

sod smoke +gzip /firms check

bb0e392ead46a02111bcf1088875fefc45503434 · 2026-05-13 05:54:56 -0700 · Steve Abrams

Files touched

Diff

commit bb0e392ead46a02111bcf1088875fefc45503434
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed May 13 05:54:56 2026 -0700

    sod smoke +gzip /firms check
---
 test/smoke.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/smoke.js b/test/smoke.js
index 4fcfb66..5dd5b15 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -14,11 +14,11 @@ const { URL } = require('url');
 const BASE = process.env.SOD_URL || 'http://127.0.0.1:9928';
 const TIMEOUT_MS = 8_000;
 
-function fetch(path) {
+function fetch(path, opts = {}) {
   const u = new URL(path, BASE);
   const lib = u.protocol === 'https:' ? https : http;
   return new Promise((resolve, reject) => {
-    const req = lib.get(u, { timeout: TIMEOUT_MS }, (res) => {
+    const req = lib.get(u, { timeout: TIMEOUT_MS, headers: opts.headers || {} }, (res) => {
       let body = '';
       res.on('data', (c) => (body += c));
       res.on('end', () => resolve({ status: res.statusCode, headers: res.headers, body }));
@@ -113,6 +113,10 @@ function check(name, cond, hint = '') {
   check('favicon: 200',                r.status === 200);
   check('favicon: image/svg',          /image\/svg/.test(r.headers['content-type'] || ''));
 
+  // gzip negotiated
+  r = await fetch('/firms', { headers: { 'Accept-Encoding': 'gzip' } });
+  check('gzip /firms',                 (r.headers['content-encoding'] || '') === 'gzip');
+
   // 10. legal pages
   r = await fetch('/about');
   check('about: 200',                  r.status === 200);

← 5379dd0 sod-smoke-quiet  ·  back to Stars of Design  ·  sod /favicon.ico Cache-Control max-age=86400 (was 0). Mirror 47f5530 →