Skip to content

Commit 8925461

Browse files
Fix double-slash in RS storage paths
The RS library appends paths to the WebFinger href (which ends with /), causing double slashes like /storage/me//notes/. Normalize these in getStoragePath().
1 parent aa606f6 commit 8925461

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/remotestorage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export async function remoteStoragePlugin (fastify, options = {}) {
3131
*/
3232
function getStoragePath (request) {
3333
const wildcard = request.params['*'] || ''
34-
return '/' + wildcard
34+
// Normalize double slashes (RS library appends path to href which ends with /)
35+
return ('/' + wildcard).replace(/\/\/+/g, '/')
3536
}
3637

3738
/**

0 commit comments

Comments
 (0)