Пример
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