Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: resolve browser downloads on Windows

[._.]/ Adam Eivy8f5fcba5bce8
diff --git a/server/services/browserService.js b/server/services/browserService.js
index 9cb62af672..185e31e05e 100644
--- a/server/services/browserService.js
+++ b/server/services/browserService.js
@@ -5,7 +5,7 @@
*/
import { readdir, stat, unlink } from 'fs/promises';
-import { join, basename, resolve, extname } from 'path';
+import { join, basename, dirname, resolve, extname } from 'path';
import { EventEmitter } from 'events';
import { ensureDir, safeJSONParse, PATHS, tryReadFile, atomicWrite, sleep } from '../lib/fileUtils.js';
import { normalizeBrowserConfig } from '../lib/browserConfig.js';
@@ -849,7 +849,7 @@ export async function resolveDownload(name) {
const safeName = basename(name || '');
if (!safeName || safeName.startsWith('.') || safeName.endsWith('.crdownload')) return null;
const absPath = resolve(downloadDir, safeName);
- if (!absPath.startsWith(downloadDir + '/')) return null;
+ if (dirname(absPath) !== downloadDir) return null;
const info = await stat(absPath).catch(() => null);
if (!info?.isFile()) return null;
const ext = extname(safeName).toLowerCase();