Skip to content

Commit 73dc04d

Browse files
committed
fix(dispatcher): only strip /v1beta variants, not plain /v1 from base URLs
1 parent 95dd434 commit 73dc04d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/backend/src/services/dispatcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ interface RetryHistoryLikeEntry {
5353
}
5454

5555
/**
56-
* Strips trailing API version path segments from base URLs.
56+
* Strips trailing /v1beta* path segments from Gemini base URLs.
5757
* Gemini's transformer adds /v1beta to the path, so we need to ensure
5858
* the base URL doesn't include it to avoid duplication like /v1beta/v1beta/...
59+
* Only strips beta versions (e.g. /v1beta, /v1beta1) — plain /v1 is valid for other APIs.
5960
*/
6061
function stripTrailingApiVersion(url: string): string {
61-
// Match trailing /v1, /v1beta, /v1beta1, etc.
62-
return url.replace(/\/(v\d+(?:beta\d*)?)$/i, '');
62+
return url.replace(/\/(v\d+beta\d*)$/i, '');
6363
}
6464

6565
export class Dispatcher {

0 commit comments

Comments
 (0)