Skip to content

fix(http): HTTPClient unusable out of the box (hardcoded http2=True) - #19

Merged
magi8101 merged 1 commit into
mainfrom
fix/httpclient-hardcoded-http2
Sep 6, 2026
Merged

fix(http): HTTPClient unusable out of the box (hardcoded http2=True)#19
magi8101 merged 1 commit into
mainfrom
fix/httpclient-hardcoded-http2

Conversation

@magi8101

@magi8101 magi8101 commented Sep 6, 2026

Copy link
Copy Markdown
Member

Found while building a real app that fetches a file by URL. connect() passed http2=True unconditionally to httpx.AsyncClient(...), which raises ImportError unless the optional 'h2' package is installed — never declared as a velocix dependency anywhere. Every HTTPClient() call, even a trivial GET, crashed for anyone who only installed velocix's declared requirements.

Made http2 a constructor param defaulting to False (httpx's own default). Added tests/test_http_client.py — this class had zero coverage before. 260/260 tests, mypy clean, ruff clean.

connect() passed http2=True unconditionally to httpx.AsyncClient(...),
which raises ImportError unless the optional 'h2' package is installed --
never declared as a velocix dependency anywhere (pyproject.toml or
requirements.txt only ever list httpx). Every HTTPClient() call, even a
trivial GET, crashed for anyone who only installed velocix's own declared
dependencies. Found while building a real app that fetches a file by URL.

Made http2 a constructor param defaulting to False (httpx's own default),
so the common case works with just httpx installed; anyone who wants
HTTP/2 can opt in and install h2 themselves. Added tests/test_http_client.py
-- this class had zero test coverage before. 260/260 tests, mypy clean,
ruff clean.
Copilot AI lite review requested due to automatic review settings September 6, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@magi8101
magi8101 merged commit 456e6e3 into main Sep 6, 2026
2 checks passed
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.

2 participants