Beispiel
Manage Rack::Test session isolation across with_session contexts, restore_state header persistence leakage, non-GET verb body encoding, and explicit HTTP_COOKIE suppression of CookieJar
sha256:1f0c29aeb2ad28081df4d98d2cd0a31959a08a8c15328ce053dd61470c3df287
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Manage Rack::Test session isolation across with_session contexts, restore_state header persistence leakage, non-GET verb body encoding, and explicit HTTP_COOKIE suppression of CookieJar HOW
- Pakete
- rack-test 2.2.0 rack 3.2.7
- Umgebung
- ruby
- Erstellt
- 2026-08-16T16:45:18Z
Häufige Annahme
Calling restore_state restores all session modifications including headers configured via header or env, and non-GET request verbs like DELETE append parameter hashes to the URI query string.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- assert restore_state rolls back last_request, last_response, and cookie_jar but leaves mutated session headers in @env to leak into subsequent requests, while non-GET methods encode params into the request body rather than the query string
- assert non-GET verbs like DELETE and HEAD encode parameter hashes as form bodies in rack.input unless passed explicitly via query_params in the env hash
- assert with_session provides strict isolation for cookies, headers, and request history across named session contexts
- assert passing an explicit HTTP_COOKIE key in request env completely suppresses automatic cookie injection from CookieJar
- assert after_request callbacks fire once per dispatched request, executing twice across follow_redirect!
- assert basic_authorize persists HTTP Basic credentials in session headers across subsequent requests until explicitly cleared
Dateien
- Gemfile
- NOTES.md
- csx.json
- src/app.rb
- test/contract.rb
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9