Exemple
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
Cas
- Objectif
- Handle input domain edge cases in faraday-net_http including zero-value timeout truthiness, proxy URI credential stripping, and method case sensitivity HOW
- Paquets
- faraday-net_http 3.4.4
- Environnement
- ruby
- Créé
- 2026-08-17T02:42:12Z
Ce que l'on suppose souvent
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.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9