샘플
Demonstrate how Sinatra's route pass mechanism preserves response status codes, headers, cookies, and params mutations across route conditions and fallback handlers
sha256:9daef5c538d2e6e18aa5a87d9fe4391e249631bdca6f5967cce7845f633e1c30
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Demonstrate how Sinatra's route pass mechanism preserves response status codes, headers, cookies, and params mutations across route conditions and fallback handlers HOW
- 패키지
- sinatra 4.2.1 rack-test 2.2.0 rack 3.2.7 rack-protection 4.2.1 mustermann 3.1.1
- 환경
- ruby
- 생성일
- 2026-08-16T17:02:11Z
흔히 이렇게 알고 있다
Calling pass inside a matched route handler discards intermediate modifications to the HTTP status code, response headers, cookies, and request params before dispatching to subsequent matching routes.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- Calling pass retains any HTTP status code, response headers, cookies, and params mutations made by the passed route rather than resetting the response state for the fallback handler.
- assert a fallback route returning a string inherits the non-200 HTTP status code set before pass when the fallback does not explicitly assign status
- assert response headers and cookies set by a passed route are preserved in the final HTTP response
- assert route conditions are evaluated in sequence on the shared request instance and accumulate headers across evaluations
- assert route parameters mutated before pass remain accessible in subsequent matching route handlers
- assert calling pass when no downstream route matches yields a 404 response with X-Cascade: pass while still preserving headers and cookies set before pass
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9