CodeSampleX

Beispiel

sinatra 4.2.1: Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash with the argument as the default value instead

Verifiziertes Beispiel für gem sinatra 4.2.1: Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash…

sha256:505354b2db0a9e15b3c1720605ee174c820a6c6345acea3e8f620bc078351ab0

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
1
Deklarierte Umgebung ruby linux x64 ruby ruby bundler

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
ruby 3 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

Fall

HOW
Ziel
Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash with the argument as the default value instead
Pakete
Symbole
  • Sinatra::IndifferentHash
  • Sinatra::IndifferentHash.new
  • Rack::Protection::EncryptedCookie
Umgebung
ruby
Erstellt
2026-08-16T17:07:41Z

Contract

  1. Sinatra::IndifferentHash.new({"role" => "admin", "id" => 7}) returns an empty hash of size 0 whose default value is the argument object, so ih["role"] returns the original seed hash rather than "admin" — the constructor no longer merges its argument in Sinatra 4
  2. ih.size == 0
  3. ih["role"] == seed_hash (returns default, not the value)
  4. ih[:role] == seed_hash (symbol access also returns the default)
  5. require 'rack/protection/encrypted_cookie' raises LoadError — EncryptedCookie was removed from rack-protection 4.x
  6. Rack::Protection.constants does not include :EncryptedCookie
  7. Sinatra::IndifferentHash['role', 'admin', 'id', 7] still populates the hash correctly — only .new(hash) is broken

Dateien

  • Gemfile
  • NOTES.md
  • app.rb
  • csx.json
  • test/contract.rb

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

csx-seed