← Back to Changelog

v4.0.0

Release

@jaredwray/mockhttp@4.0.0 — 2026-11-19

Bin management requires an owner token. A reserved header name returns HTTP 400.

⚠ BREAKING CHANGES

  • Bin management routes require an owner token. MockHttpBins throws when idLength is not a positive integer (#275) Migration: Read token from POST /bins. Send Authorization: Bearer <token> on each later /bins call. The capture path /b/:id stays open. In-process methods such as getBin do not require the token.

    # Before 4.0.0
    POST /bins            → 200 { "id", "url", "createdAt", "expiresAt", "requestCount" }
    GET  /bins            → 200 { "bins": [ ...every bin ] }
    GET  /bins/:id        → 200 bin metadata
    
    # After 4.0.0
    POST /bins            → 200 { "id", "token", "url", "createdAt", "expiresAt", "requestCount" }
    GET  /bins            → 401 without a token; 200 { "bins": [ that bin ] } with Bearer
    GET  /bins/:id        → 401 { "error": "unauthorized" } without a token
    GET  /bins/:id        → 404 { "error": "bin_not_found" } for a wrong token
    ANY  /b/:id           → unchanged (no token)
    

Bug Fixes

  • Reject reserved header names on /response-headers (#277)

    # Before
    GET /response-headers?trailer=x  → process exit (ERR_HTTP_TRAILER_INVALID)
    
    # After
    GET /response-headers?trailer=x  → 400 { "error": "The header name \"trailer\" is not permitted." }
    

Documentation

  • Update the Safe Chain section in AGENTS.md (#270)

Internal

  • Update the undici override from 7.30.1 to 8.12.2 (#271)
  • Remove the set-cookie-parser override. The lockfile still resolves 2.7.3 (#272)
  • Upgrade Biome to 2.6.6 and Vitest to 5.1.0 (#273)
  • Upgrade @swc/core to 1.16.22, tsdown to 0.23.7, and vite to 8.3.8 (#274)
  • Upgrade the package manager to pnpm 12.20.0 (#276)
  • Upgrade the GitHub Actions pins (#278)
  • Upgrade the Dev Container image to 5.2.5 (#279)
  • Refresh the Node.js runtime image digest. The tag stays node:24.22.3-alpine3.24 (#280)
  • Upgrade Biome to 2.6.7 (#281)
  • Upgrade fastify to 5.12.8, cookie to 11.1.5, helmet to 13.2.0, rate-limit to 11.2.2, and swagger to 9.9.3 (#282)
  • Upgrade the MongoDB driver from 7.8.0 to 7.9.0 (#283)
  • Upgrade hookified from 3.0.4 to 3.1.0 (#284)
  • Upgrade docula from 3.0.1 to 3.0.2 (#285)
  • Upgrade wrangler from 4.127.0 to 4.161.0 (#286)
  • Remove the sharp override. The resolved version stays 0.35.5 (#287)

Contributors

  • @jaredwray (18)

Full List of Changes

  • root - chore: sync defense-in-depth files from agentic by @jaredwray in #270
  • root - chore: update undici override by @jaredwray in #271
  • root - chore: remove set-cookie-parser override by @jaredwray in #272
  • @jaredwray/mockhttp - chore: upgrade code quality dependencies by @jaredwray in #273
  • @jaredwray/mockhttp - chore: upgrade TypeScript and build tooling by @jaredwray in #274
  • @jaredwray/mockhttp - chore: upgrade monorepo tooling by @jaredwray in #276
  • Reject reserved header names on /response-headers by @jaredwray in #277
  • root - chore: upgrade GitHub Actions by @jaredwray in #278
  • fix(security): bin owner tokens and reject framing headers in /response-headers by @jaredwray in #275
  • root - chore: upgrade Dev Container images by @jaredwray in #279
  • root - chore: upgrade Docker Node.js runtime image by @jaredwray in #280
  • @jaredwray/mockhttp - chore: upgrade code quality dependencies by @jaredwray in #281
  • @jaredwray/mockhttp - chore: upgrade Fastify dependencies by @jaredwray in #282
  • @jaredwray/mockhttp - chore: upgrade mongodb by @jaredwray in #283
  • @jaredwray/mockhttp - chore: upgrade hookified by @jaredwray in #284
  • @jaredwray/mockhttp - chore: upgrade docula by @jaredwray in #285
  • @jaredwray/mockhttp - chore: upgrade wrangler by @jaredwray in #286
  • root - chore: remove sharp override by @jaredwray in #287

Full diff: https://github.com/jaredwray/mockhttp/compare/v3.0.2...v4.0.0