Skip to content

Add headers - #46

Merged
iamalwaysuncomfortable merged 2 commits into
masterfrom
feat/user-agent-header
Jul 13, 2026
Merged

Add headers#46
iamalwaysuncomfortable merged 2 commits into
masterfrom
feat/user-agent-header

Conversation

@iamalwaysuncomfortable

@iamalwaysuncomfortable iamalwaysuncomfortable commented Jul 13, 2026

Copy link
Copy Markdown
Member

Header management.

Set User-Agent: aleo-python-sdk/<version> on all SDK requests — reads, JWT
refresh, the prover handshake, and every scanner call — so the SDK is
identifiable in standard access logs (overriding the python-requests/httpx
default). Injected at the two per-request header layers (network client's
method_headers and the scanner's _build_headers, sync + async, including their
JWT-refresh sub-requests). Registered in SDK_HEADERS so it's suppressed when the
caller supplies their own transport, matching the existing x-aleo-* headers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@iamalwaysuncomfortable iamalwaysuncomfortable changed the title Send a User-Agent identifying the Python SDK on every call Add headers Jul 13, 2026
Drop "user-agent" from SDK_HEADERS. The UA is only ever added on the default
transport (in method_headers' non-custom branch), so it was never present to
"suppress" under a custom transport — the only effect of the SDK_HEADERS entry
was to delete a User-Agent the CALLER set, which is the opposite of hands-off.
With a custom transport the SDK now layers nothing of its own; the caller's
headers pass through untouched. Adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@iamalwaysuncomfortable
iamalwaysuncomfortable merged commit fe90b55 into master Jul 13, 2026
16 of 18 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