diff options
| author | Aiden Cline <[email protected]> | 2026-03-12 15:41:46 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-12 15:41:46 -0500 |
| commit | d722026a8dffe3a9678ffb82cab72bcde0fde720 (patch) | |
| tree | 187f08067bec1b86fb5cff6e18d39c9e22fa3c45 | |
| parent | 42a5af6c8f6998277cf69270ad12e2a64edac5d3 (diff) | |
| download | opencode-d722026a8dffe3a9678ffb82cab72bcde0fde720.tar.gz opencode-d722026a8dffe3a9678ffb82cab72bcde0fde720.zip | |
fix: if server password exists, use basic auth for plugin client by default (#17213)
| -rw-r--r-- | packages/opencode/src/plugin/index.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.ts index 1b9d009aa..8790efac4 100644 --- a/packages/opencode/src/plugin/index.ts +++ b/packages/opencode/src/plugin/index.ts @@ -25,6 +25,11 @@ export namespace Plugin { const client = createOpencodeClient({ baseUrl: "http://localhost:4096", directory: Instance.directory, + headers: Flag.OPENCODE_SERVER_PASSWORD + ? { + Authorization: `Basic ${Buffer.from(`${Flag.OPENCODE_SERVER_USERNAME ?? "opencode"}:${Flag.OPENCODE_SERVER_PASSWORD}`).toString("base64")}`, + } + : undefined, fetch: async (...args) => Server.Default().fetch(...args), }) const config = await Config.get() |
