mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix: always override directory query param when slug header is present
The TUI sends its local CWD as directory=... (e.g. /Users/chris) but the managed opencode needs the repo's actual fullPath. Previously the proxy only set directory if missing, so the TUI's local path leaked through. Now when x-opencode-manager-project header is set, the repo's fullPath always replaces any client-supplied directory value.
This commit is contained in:
1 parent
4407ad15fb
commit
7870e97c38
2 files changed
+2
-6
No files matched your search
@@ -117,9 +117,7 @@ export function attachWorkspacePluginWs(server: Server, options: WebSocketProxyO
|
||||
return
|
||||
}
|
||||
const targetUrlObj = new URL(targetUrl)
|
||||
if (!targetUrlObj.searchParams.has('directory')) {
|
||||
targetUrlObj.searchParams.set('directory', project.directory)
|
||||
}
|
||||
targetUrlObj.searchParams.set('directory', project.directory)
|
||||
targetUrl = targetUrlObj.toString()
|
||||
}
|
||||
|
||||
|
||||
@@ -314,9 +314,7 @@ export async function proxyRequest(request: Request, projectService?: ProxyProje
|
||||
return new Response('Unknown project', { status: 404 })
|
||||
}
|
||||
const targetUrlObj = new URL(targetUrl)
|
||||
if (!targetUrlObj.searchParams.has('directory')) {
|
||||
targetUrlObj.searchParams.set('directory', project.directory)
|
||||
}
|
||||
targetUrlObj.searchParams.set('directory', project.directory)
|
||||
targetUrl = targetUrlObj.toString()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user