Beispiel
Handle input domain edge cases in faraday-net_http including zero-value timeout truthiness, proxy URI credential stripping, and method case sensitivity
sha256:e668d3939be32bcc4025992632f9fe80e4deafc0671e490a16ae14f95099d26d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Handle input domain edge cases in faraday-net_http including zero-value timeout truthiness, proxy URI credential stripping, and method case sensitivity HOW
- Pakete
- faraday-net_http 3.4.4
- Umgebung
- ruby
- Erstellt
- 2026-08-17T02:42:12Z
Häufige Annahme
Setting a request timeout of 0 or passing proxy credentials inside the URI object disables timeouts and authenticates the proxy connection in Faraday's Net::HTTP adapter.
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
- Setting request timeout to 0 configures Net::HTTP read, open, and write timeouts to 0 seconds rather than disabling timeouts or falling back to defaults because 0 is truthy in Ruby.
- Passing proxy credentials inside the proxy URI object leaves Net::HTTP proxy_user and proxy_pass as nil unless explicitly set in top-level proxy option keys.
- Setting a specific read_timeout of 0 overrides a broader timeout fallback of 10 seconds rather than falling back to 10.
- Passing a method of :HEAD as an uppercase symbol or string sets Net::HTTPGenericRequest response_body_permitted to true because the adapter checks only lowercase symbol :head.
- Omitting proxy configuration passes an explicit nil proxy argument to Net::HTTP.new, disabling automatic ENV proxy inheritance.
- Parsing an IPv6 literal URL extracts the bracketless address ::1 for Net::HTTP connection creation.
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- 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-17 · ed25519:d91480838ac982c9