From 1c918d82daab3adfcdc9731f83c37c74c48eeb60 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 30 Mar 2024 15:39:35 +0800 Subject: [PATCH] allowing # in onedrive --- src/remoteForOnedrive.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/remoteForOnedrive.ts b/src/remoteForOnedrive.ts index 37a11cc..d554892 100644 --- a/src/remoteForOnedrive.ts +++ b/src/remoteForOnedrive.ts @@ -471,6 +471,11 @@ export class WrappedOnedriveClient { const pathFrag = encodeURI(pathFragOrig); theUrl = `${API_PREFIX}${pathFrag}`; } + // we want to support file name with hash # + // because every url we construct here do not contain the # symbol + // thus it should be safe to directly replace the character + theUrl = theUrl.replace(/#/g, "%23"); + // console.debug(`building url: [${pathFragOrig}] => [${theUrl}]`) return theUrl; };