Skip to content

Commit 29174b3

Browse files
committed
docs: add clarifying comment for URL construction logic
1 parent 19625b4 commit 29174b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/api/providers/fetchers/requesty.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export async function getRequestyModels(baseUrl?: string, apiKey?: string): Prom
1717

1818
const resolvedBaseUrl = toRequestyServiceUrl(baseUrl)
1919
// Ensure the base URL ends with a slash so "models" is appended correctly
20+
// Without this, new URL("models", "https://custom.requesty.ai/v1") would incorrectly
21+
// resolve to "https://custom.requesty.ai/models" instead of "https://custom.requesty.ai/v1/models"
2022
const baseWithSlash = resolvedBaseUrl.endsWith("/") ? resolvedBaseUrl : `${resolvedBaseUrl}/`
2123
const modelsUrl = new URL("models", baseWithSlash)
2224

0 commit comments

Comments
 (0)