fix(api): support absolute paths in BaseApiClient.request()
When path starts with /api/, treat it as an absolute URL instead of prepending baseUrl. This fixes installSkill/uninstallSkill URL concatenation that produced /api/v1/skill-management/api/v1/skills/...
This commit is contained in:
parent
5b63214bc1
commit
af50cc7fe1
|
|
@ -14,7 +14,8 @@ export class BaseApiClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async request<T>(path: string, options: RequestInit = {}): Promise<T> {
|
protected async request<T>(path: string, options: RequestInit = {}): Promise<T> {
|
||||||
const url = `${this.baseUrl}${path}`
|
// If path starts with /api/, it's an absolute path — don't prepend baseUrl
|
||||||
|
const url = path.startsWith('/api/') ? path : `${this.baseUrl}${path}`
|
||||||
const headers: Record<string, string> = {
|
const headers: Record<string, string> = {
|
||||||
...options.headers as Record<string, string>,
|
...options.headers as Record<string, string>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue