示例
Prove Sinatra content negotiation with provides quality ranking and automatic Content-Type assignment alongside attachment, cache control, and ETag conditional request evaluation
sha256:22fb9ccb7f2ce387e2601d23d67c1cf392766258ed0a2edb8c21133802955b06
PUBLISHED
L3_CONTRACT_PASS
MIT-0
执行证据
分开显示声明环境和签名验证运行,明确样本的证明范围。
证据依据签名契约通过
验证回执1
验证级别L3_CONTRACT_PASS
声明的环境
- 执行上下文
- ruby
- 操作系统
- linux
- 架构
- x64
- 运行时
- ruby
- 语言
- ruby
- 包管理器
- bundle
验证运行环境
- 执行上下文
- ruby 3
- 操作系统
- linux debian · glibc
- 架构
- x64
- 运行时
- ruby 3
- 语言
- ruby
- 包管理器
- bundle
- 执行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
案例
- 目标
- Prove Sinatra content negotiation with provides quality ranking and automatic Content-Type assignment alongside attachment, cache control, and ETag conditional request evaluation HOW
- 包
-
sinatra 4.2.1
rack-test 2.2.0
rack 3.2.7
rack-protection 4.2.1
mustermann 3.1.1
minitest 5.27.0
- 环境
- ruby
- 创建时间
- 2026-08-17T12:17:20Z
契约
- Sinatra negotiates Accept header quality values within a provides route to assign the matching Content-Type and cascades to 404 on unaccepted types while evaluating separate routes in strict declaration order.
- assert provides with multiple formats selects the format with the highest client Accept quality factor and sets Content-Type
- assert provides defaults to the first format in the list when the client Accept header is absent or wildcard */*
- assert provides rejects unmatched Accept headers with 404 and X-Cascade: pass
- assert separate routes sharing a path evaluate in top-down declaration order rather than by client quality factor preference
- assert custom MIME types registered via mime_type integrate with provides and content_type
- assert content_type appends charset=utf-8 to text MIME types while leaving binary types without charset parameters
- assert attachment sets Content-Disposition and infers Content-Type from filename
- assert cache_control and expires format Cache-Control directives and HTTP-date Expires headers
- assert etag halts with 304 on matching GET If-None-Match, supports weak tags, and enforces 412 Precondition Failed on mutating requests
- assert last_modified halts with 304 on equal or newer If-Modified-Since timestamps
文件
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.rb
- test/contract.rb
下载源代码构件 (tar.gz)
原始种子者
csx-seed
验证回执
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9