Skip to content

fix(client): merge HTTP headers case-insensitively - #3486

Merged
marcuswood-oai merged 2 commits into
openai:mainfrom
fallintoplace:fix/case-insensitive-header-merging
Sep 23, 2026
Merged

marcuswood-oai merged 2 commits into
openai:mainfrom
fallintoplace:fix/case-insensitive-header-merging

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

HTTP header names are case-insensitive, but differently cased overrides currently leave duplicate values, and Omit() can fail to remove an earlier value. Merge HTTP headers case-insensitively so later values replace earlier ones and explicit removal respects casing.

The change is limited to HTTP header merging, with one parametrized regression test covering default overrides, per-request overrides, and removal for sync and async clients.

Validation: 807 tests passed across client, authentication, Azure, Bedrock, redirect, and HTTPX compatibility coverage; focused Pydantic v1 checks, Ruff, Pyright, mypy, and the custom-code budget passed.

@fallintoplace
fallintoplace requested a review from a team as a code owner July 10, 2026 23:40
@marcuswood-oai marcuswood-oai changed the title Fix case-insensitive header overrides fix(client): merge HTTP headers case-insensitively Sep 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching this and putting together the fix! We’ve merged main into your branch, narrowed the patch to HTTP header merging, and tightened the tests. Everything we checked is passing—happy to get this in!

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

47 mixed files remain; 0 existing customizations changed.

Compared ead1fa247325 → 9c23e2dda7b4. Generated baselines verified.

47 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/api.md
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py
  • src/openai/types/realtime/realtime_error_event.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py

7 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 35894002224 --repo openai/openai-python \
  --name castiron-custom-code-35894002224-1 --dir /tmp/castiron-custom-code-35894002224-1
git apply --stat /tmp/castiron-custom-code-35894002224-1/custom-code.patch
cat /tmp/castiron-custom-code-35894002224-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin ead1fa2473257ba5d7be08484aca4349649e6245 9c23e2dda7b4d6f61f3123ad89e01ad0e80e6fa9
python3 scripts/castiron/custom_code_report.py report \
  --base ead1fa2473257ba5d7be08484aca4349649e6245 \
  --head 9c23e2dda7b4d6f61f3123ad89e01ad0e80e6fa9 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-9c23e2dda7b4
cat /tmp/castiron-custom-code-9c23e2dda7b4/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Sep 23, 2026
Merged via the queue into openai:main with commit 5e39766 Sep 23, 2026
18 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Sep 23, 2026
pull Bot pushed a commit to Mattlk13/openai-python that referenced this pull request Sep 23, 2026
Automated Release PR
---


##
[3.19.1](openai/openai-python@v3.19.0...v3.19.1)
(2026-09-23)


### Bug Fixes

* **chat:** preserve single-pass tool iterables
([openai#3770](openai#3770))
([33ffa1f](openai@33ffa1f))
* **client:** merge HTTP headers case-insensitively
([openai#3486](openai#3486))
([5e39766](openai@5e39766))


### Chores

* **api:** clarify Chat Completions seed limits
([openai#3945](openai#3945))
([be9d666](openai@be9d666))


### Documentation

* clarify collaborator-only pull request policy
([openai#3948](openai#3948))
([ead1fa2](openai@ead1fa2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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