feat(http): implement HTTP client with context, timeouts, and cookie jar #127

Merged
fuzzy merged 2 commits from feat/http-client into main 2026-07-13 17:30:28 +00:00
Owner

What

Create HTTP client wrapper in internal/downloader with context support, configurable timeouts, custom User-Agent headers, and a cookie jar.

Why

Foundation for HTTP download functionality — all HTTP requests will go through this client.

Testing

  • go vet ./... passes
  • go build ./... passes
  • golangci-lint run ./... passes
  • Pre-commit hooks pass

Breaking Changes

None

Notes

  • Client timeout sourced from Config.Timeout
  • Transport configured with ResponseHeaderTimeout and IdleConnTimeout
  • Cookie jar initialized via net/http/cookiejar for future session support
  • NewRequest() helper sets User-Agent from config, creates request with context

Closes #0023
Closes #0024
Closes #0025
Closes #0026

## What Create HTTP client wrapper in `internal/downloader` with context support, configurable timeouts, custom User-Agent headers, and a cookie jar. ## Why Foundation for HTTP download functionality — all HTTP requests will go through this client. ## Testing - [x] `go vet ./...` passes - [x] `go build ./...` passes - [x] `golangci-lint run ./...` passes - [x] Pre-commit hooks pass ## Breaking Changes None ## Notes - Client timeout sourced from `Config.Timeout` - Transport configured with `ResponseHeaderTimeout` and `IdleConnTimeout` - Cookie jar initialized via `net/http/cookiejar` for future session support - `NewRequest()` helper sets User-Agent from config, creates request with context Closes #0023 Closes #0024 Closes #0025 Closes #0026
Closes #0023 Closes #0024 Closes #0025 Closes #0026
docs(roadmap): mark HTTP client complete
All checks were successful
Test and Release / test (pull_request) Successful in 2m1s
Test and Release / lint (pull_request) Successful in 2m54s
5fb4975be7
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-13 17:28:02 +00:00
the.auditor left a comment

Review: APPROVED

Verification

  • go vet ./... passes
  • go build ./... passes
  • golangci-lint v2 run ./... 0 issues

Changes

  • internal/downloader/client.go (new) — HTTP client wrapper with timeouts, transport config, cookie jar, User-Agent
  • ROADMAP.md — Marks Phase 2 HTTP client items as [x]

Suggestions (non-blocking)

  • #128NewRequest requires cfg again; store userAgent on Client struct
  • #129 — Missing tests for downloader/client.go

Closes #0023, #0024, #0025, #0026 on merge.

## Review: APPROVED ### Verification - `go vet ./...` — ✅ passes - `go build ./...` — ✅ passes - `golangci-lint v2 run ./...` — ✅ 0 issues ### Changes - `internal/downloader/client.go` (new) — HTTP client wrapper with timeouts, transport config, cookie jar, User-Agent - `ROADMAP.md` — Marks Phase 2 HTTP client items as [x] ### Suggestions (non-blocking) - #128 — `NewRequest` requires `cfg` again; store userAgent on Client struct - #129 — Missing tests for downloader/client.go Closes #0023, #0024, #0025, #0026 on merge.
fuzzy merged commit 5fb4975be7 into main 2026-07-13 17:30:28 +00:00
fuzzy deleted branch feat/http-client 2026-07-13 17:30:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget!127
No description provided.