mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Fix URL parsing for relative paths in SDK client
This commit is contained in:
parent
126f2b0600
commit
de08ba0064
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ export function createOpencodeClient(config?: Config & { directory?: string }) {
|
|||
}
|
||||
}
|
||||
|
||||
if (config?.baseUrl) {
|
||||
if (config?.baseUrl && /^https?:\/\//.test(config.baseUrl)) {
|
||||
const baseUrl = new URL(config.baseUrl)
|
||||
if (baseUrl.username || baseUrl.password) {
|
||||
config.headers = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue