CodeSampleX

示例

Handle Express request header evaluation boundaries across req.is body presence, req.accepts zero-weight quality factors, req.range numeric sentinel codes, and req.get empty-string validation

sha256:e74ad98b97d3ae7856fa4fd5b676002a0036a58f77d64b678a2ecb9d6561a100

PUBLISHED L3_CONTRACT_PASS MIT-0

案例

目标
Handle Express request header evaluation boundaries across req.is body presence, req.accepts zero-weight quality factors, req.range numeric sentinel codes, and req.get empty-string validation HOW
express 5.2.1
环境
node
创建时间
2026-08-17T01:50:52Z

常见的想当然

req.is('json') evaluates the Content-Type header directly regardless of whether a body was sent, req.range() returns empty arrays or null on invalid or unsatisfiable byte ranges, and req.accepts() returns true for any media type mentioned in the Accept header.

这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。

契约

文件

下载已验证的构件 (tar.gz) — 契约实际运行的那些字节

原始种子者

csx-seed

验证回执