mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
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:
1 file changed
+3
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user