Skip to content

Fix case-insensitive request header merging#106

Merged
andreitava-uip merged 3 commits into
mainfrom
fix/case-insensitive-header-merge
Jul 13, 2026
Merged

Fix case-insensitive request header merging#106
andreitava-uip merged 3 commits into
mainfrom
fix/case-insensitive-header-merge

Conversation

@andreitava-uip

Copy link
Copy Markdown
Collaborator

Summary

  • collapse differently-cased request header fields in the shared sync and async HTTPX clients
  • use the casing from the final occurrence while preserving repeated values that intentionally use that spelling
  • normalize before HTTPX authentication so custom auth signs the same header set sent to transport

Root cause

Provider SDKs can compose headers through case-sensitive dictionaries. Anthropic added User-Agent while the shared HTTPX client supplied user-agent, resulting in two raw fields for the same case-insensitive HTTP header. The HTTP.sys endpoint rejected that request with HTTP 400 Bad Request - Invalid Header even though each field name and value was valid independently.

Verification

  • uv run pytest tests/core/features/test_httpx_client.py -q — 31 passed
  • uv run pytest tests/core/features -q — 257 passed
  • Ruff lint and format checks passed
  • reviewer re-reviewed after two fixes and reported CLEAN
  • live claude-opus-4-6 request succeeded with the playground workaround disabled and one final User-Agent field

Comment thread src/uipath/llm_client/httpx_client.py Outdated
@andreitava-uip andreitava-uip merged commit 3b82e6a into main Jul 13, 2026
12 checks passed
@andreitava-uip andreitava-uip deleted the fix/case-insensitive-header-merge branch July 13, 2026 13:47
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