Skip to content

fix(client): omit User-Agent in browser requests#1882

Open
MukundaKatta wants to merge 1 commit into
openai:masterfrom
MukundaKatta:codex/openai-node-browser-user-agent
Open

fix(client): omit User-Agent in browser requests#1882
MukundaKatta wants to merge 1 commit into
openai:masterfrom
MukundaKatta:codex/openai-node-browser-user-agent

Conversation

@MukundaKatta
Copy link
Copy Markdown

Fixes #1694.

Summary

  • omit the SDK-generated User-Agent header when the client is running in a browser-like environment
  • keep the existing User-Agent behavior for Node, Deno, edge, and other non-browser runtimes
  • add a regression test for dangerouslyAllowBrowser requests so browser usage does not send a forbidden header

Tests

  • ./node_modules/.bin/jest tests/index.test.ts --runInBand -t "omits forbidden User-Agent"
  • ./node_modules/.bin/prettier --check src/client.ts tests/index.test.ts
  • ./node_modules/.bin/eslint src/client.ts tests/index.test.ts
  • PATH=/Users/ubl/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH ./scripts/build

@MukundaKatta MukundaKatta requested a review from a team as a code owner May 15, 2026 15:43
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.

req header user-agent is not a normal value in safari

1 participant