Skip to content

Use shared HTTP client for upstream metadata requests#29

Merged
andrew merged 1 commit into
mainfrom
fix-metadata-http-client
Mar 13, 2026
Merged

Use shared HTTP client for upstream metadata requests#29
andrew merged 1 commit into
mainfrom
fix-metadata-http-client

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Mar 13, 2026

All 16 handlers were using http.DefaultClient for upstream metadata requests, which meant no timeout and no shared configuration. Artifact downloads already went through the Proxy.Fetcher with circuit breaker protection, but metadata fetches did not.

Adds an HTTPClient field to the Proxy struct, initialized with a 30-second timeout in NewProxy. All handlers now use h.proxy.HTTPClient.Do(req) instead of http.DefaultClient.Do(req).

…ttp.DefaultClient

All handler metadata and proxy requests were using http.DefaultClient directly,
bypassing any timeout or transport configuration. Added an HTTPClient field to
the Proxy struct with a 30-second default timeout, and updated every handler
to use it for upstream HTTP requests.
@andrew andrew merged commit 07e5831 into main Mar 13, 2026
5 checks passed
@andrew andrew deleted the fix-metadata-http-client branch March 26, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant