fix(FN-000): improve setup wizard browse flow
This commit is contained in:
@@ -303,8 +303,8 @@ describe("browseDirectory API function", () => {
|
||||
await browseDirectory("/home", false, "node-remote-1", "node-local-1");
|
||||
|
||||
expect(globalThis.fetch).toHaveBeenCalledWith(
|
||||
expect.stringContaining("/api/proxy/node-remote-1/browse-directory"),
|
||||
expect.any(Object)
|
||||
expect.stringContaining("/api/browse-directory?path=%2Fhome&nodeId=node-remote-1"),
|
||||
expect.any(Object),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15028,7 +15028,7 @@ async function persistImportedSkills(
|
||||
// Node-aware proxying: route to remote node if nodeId is provided and not local
|
||||
if (nodeId) {
|
||||
const { CentralCore } = await import("@fusion/core");
|
||||
const central = new CentralCore();
|
||||
const central = new CentralCore(store.getFusionDir());
|
||||
await central.init();
|
||||
|
||||
const localNodes = await central.listNodes();
|
||||
@@ -15063,6 +15063,10 @@ async function persistImportedSkills(
|
||||
signal: AbortSignal.timeout(30000),
|
||||
});
|
||||
|
||||
if (proxyRes.status === 401 && !node.apiKey) {
|
||||
throw unauthorized("Remote node rejected directory browse request. Configure an apiKey for that node in Fusion settings.");
|
||||
}
|
||||
|
||||
const body = Buffer.from(await proxyRes.arrayBuffer());
|
||||
// Filter hop-by-hop headers
|
||||
const skipHeaders = new Set(["connection", "keep-alive", "transfer-encoding", "upgrade"]);
|
||||
|
||||
Reference in New Issue
Block a user