From ee89ae602b5a38721054f619aa04743156699b08 Mon Sep 17 00:00:00 2001 From: Aissa Benfodda <68044105+Rygaa@users.noreply.github.com> Date: Wed, 13 May 2026 05:15:43 -0400 Subject: [PATCH] Server: Fixes #15395: Static asset resolution fails on Windows due to backslash path separators (#15396) --- packages/server/src/routes/default.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/routes/default.ts b/packages/server/src/routes/default.ts index b662ef4e5d..cbccbfa49e 100644 --- a/packages/server/src/routes/default.ts +++ b/packages/server/src/routes/default.ts @@ -9,6 +9,7 @@ import { localFileFromUrl } from '../utils/joplinUtils'; import { homeUrl, loginUrl } from '../utils/urlUtils'; import * as mime from '@joplin/lib/mime-utils'; import { hasOwnProperty } from '@joplin/utils/object'; +import { toForwardSlashes } from '@joplin/utils/path'; const publicDir = `${dirname(dirname(__dirname))}/public`; @@ -34,7 +35,7 @@ async function findLocalFile(path: string): Promise { const appFilePath = await localFileFromUrl(path); if (appFilePath) return appFilePath; - let localPath = normalize(path); + let localPath = toForwardSlashes(normalize(path)); if (localPath.indexOf('..') >= 0) throw new ErrorNotFound(`Cannot resolve path: ${path}`); if (hasOwnProperty(pathToFileMap, path)) return pathToFileMap[path];