Ejemplo
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
Caso
- Objetivo
- Handle input domain edge cases in faraday-net_http including zero-value timeout truthiness, proxy URI credential stripping, and method case sensitivity HOW
- Paquetes
- faraday-net_http 3.4.4
- Entorno
- ruby
- Creado
- 2026-08-17T02:42:12Z
Lo que suele suponerse
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.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- 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.
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9