cc-os/plugins/os-adr/eval-b/fixture/project/docs/adr/0002-route-all-outbound-htt...

1.1 KiB

id date status supersedes superseded-by affected-paths affected-components
0002 2026-02-18 Accepted
lib/relay/http_client.rb
lib/relay/delivery.rb
http
delivery

0002 — Route all outbound HTTP through the shared HttpClient

Context

Two call sites had grown their own Net::HTTP usage with inconsistent timeouts and no shared User-Agent, and a TLS verification bug had to be fixed in both places separately.

Decision

All outbound HTTP goes through Relay::HttpClient (lib/relay/http_client.rb). No other file constructs Net::HTTP objects directly — timeouts, TLS policy, headers, and instrumentation live in exactly one place.

Consequences

One place to change HTTP policy; call sites cannot drift. New delivery types must accept the small indirection of going through the wrapper even for trivial requests.

Alternatives rejected

Per-call-site Net::HTTP rejected: policy drift was the concrete bug that motivated this. Pulling in a full HTTP gem (faraday) rejected: stdlib is sufficient at this scale and keeps the tool dependency-free.