CodeSampleX

Sample

faraday 2.14.3: Handle Faraday URL path prefixes, parameter encoding differences, and auth header changes without silent request corruption

Verified sample for gem faraday 2.14.3: Handle Faraday URL path prefixes, parameter encoding differences, and auth header changes without silent request…

sha256:90c80281854e0f5588fad1cda97ddabfcf6bdcb6221dbe5d9e6d81a7a027955d

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
1
Declared environment ruby linux x64 ruby ruby rubygems

Verification-run environments

Environment Contract Stages Run
ruby 3 · linux debian/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

Case

HOW
Goal
Handle Faraday URL path prefixes, parameter encoding differences, and auth header changes without silent request corruption
Packages
Symbols
  • Faraday.new
  • Faraday::Connection#build_url
  • Faraday::NestedParamsEncoder
  • Faraday::FlatParamsEncoder
  • Faraday::Request::UrlEncoded
  • Faraday::Request::Authorization
Environment
ruby
Created
2026-08-16T17:33:25Z

Contract

  1. assert a leading slash in a request path drops the connection url_prefix path under RFC 3986 URI resolution
  2. assert a relative request path without a leading slash appends to the url_prefix path
  3. assert a trailing slash on the base URL still drops the path prefix when the request path starts with a slash
  4. assert NestedParamsEncoder brackets array query parameters with empty brackets by default
  5. assert FlatParamsEncoder repeats array query keys without brackets and stringifies nested hashes
  6. assert a nil query parameter value encodes as a valueless key without an equals sign while an empty string includes the equals sign
  7. assert FlatParamsEncoder decodes valueless query keys as boolean true while NestedParamsEncoder decodes them as nil
  8. assert request params override request URL query params which override connection default params in a merged query
  9. assert block initialization replaces the middleware stack leaving Hash request bodies unencoded without UrlEncoded middleware
  10. assert Faraday 2 removes basic_auth and token_auth instance methods on Connection in favor of set_basic_auth and authorization middleware
  11. assert authorization middleware formats basic and bearer authorization headers

Files

  • Gemfile
  • NOTES.md
  • csx.json
  • src/client.rb
  • test/contract.rb

Download the source artifact (tar.gz)

Origin Seeder

csx-seed