Fix protocol handler to strip trailing slashes

The URL app://index.html/ was failing because of the trailing slash.
Now strips trailing slashes before resolving file paths.
This commit is contained in:
Alex Gleason committed 2025-10-24 23:11:05 -05:00
1 parent c833716723
commit 58b4d1562d
1 file changed
+3
+3
View File
@@ -114,6 +114,9 @@ app.whenReady().then(async () => {
// Remove 'app://' prefix and normalize path
let filePath = request.url.replace('app://', '');
// Remove trailing slashes
filePath = filePath.replace(/\/+$/, '');
// Handle root path
if (filePath === '' || filePath === '/') {
filePath = 'index.html';