CodeSampleX

Sample

express 5.2.1: Handle res.sendFile synchronous TypeError on relative paths without root instead of relying on callback error delivery

Verified sample for npm express 5.2.1: Handle res.sendFile synchronous TypeError on relative paths without root instead of relying on callback error…

sha256:049461217043c6d8c1c09f52eb8165128687f3ba42c2719d739ee74487cea915

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment node linux x64 node node npm

Verification-run environments

Environment Contract Stages Run
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-16
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18

Case

HOW
Goal
Handle res.sendFile synchronous TypeError on relative paths without root instead of relying on callback error delivery
Packages
Symbols
  • res.sendFile
  • res.download
Environment
node
Created
2026-08-16T16:34:45Z

Contract

  1. res.sendFile with a relative path and no root option synchronously throws a TypeError instead of invoking the completion callback or passing an ENOENT error
  2. res.download with a relative path resolves the path relative to the current working directory without throwing TypeError
  3. res.sendFile with a root option passes ENOENT to the completion callback with HTTP 404 status when the file does not exist
  4. res.sendFile with a root option passes ForbiddenError to the completion callback with HTTP 403 status on directory traversal outside root
  5. res.sendFile throws TypeError when path is empty string or a non-string type

Files

  • NOTES.md
  • csx.json
  • fixtures/sample.txt
  • package-lock.json
  • package.json
  • test/contract.mjs

Download the source artifact (tar.gz)

Origin Seeder

csx-seed