Skip to content

fix(azure): normalize endpoint trailing slashes#1995

Open
HAYDEN-OAI wants to merge 2 commits into
mainfrom
dev/hayden/issue-1669-normalize-azure-endpoint
Open

fix(azure): normalize endpoint trailing slashes#1995
HAYDEN-OAI wants to merge 2 commits into
mainfrom
dev/hayden/issue-1669-normalize-azure-endpoint

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • normalize AzureOpenAI endpoints before appending /openai
  • add a focused regression test for the documented trailing-slash endpoint form

Why

AzureClientOptions.endpoint is documented with a trailing slash, but the constructor appended /openai directly. Passing the documented form produced a base URL such as https://example-resource.azure.openai.com//openai, which then carried the double slash into Azure request URLs.

Impact

new AzureOpenAI({ endpoint: 'https://example-resource.azure.openai.com/' }) now produces https://example-resource.azure.openai.com/openai. Endpoints without trailing slashes and callers that provide an explicit baseURL keep their existing behavior.

Fixes #1669.

Validation

  • pnpm exec jest tests/lib/azure.test.ts --runInBand
  • pnpm exec prettier --check src/azure.ts tests/lib/azure.test.ts
  • pnpm run lint

Comment thread src/azure.ts Fixed
@HAYDEN-OAI HAYDEN-OAI marked this pull request as ready for review July 13, 2026 22:43
@HAYDEN-OAI HAYDEN-OAI requested a review from a team as a code owner July 13, 2026 22:43
@openai-sdks

openai-sdks Bot commented Jul 13, 2026

Copy link
Copy Markdown

OkTest Summary

Failed for Node SDK PR #1995.

View OkTest run #29291098950

SDK merge (518fe091ab5e) · head (a6d54948d2be) · base (1cdc0196b434) · OkTest (cb7f0514ccd2)

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.

openAI AzureOpenAI baseURL issue.

3 participants