Skip to content

Commit

Permalink
Strip trailing any / from serverUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodearnest committed Oct 17, 2023
1 parent fe92036 commit b705e78
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sacro-app/src/create-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ const { waitThenLoad } = require("./utils");

let TEMPDIR = null;

function rtrim(x, characters) {
var start = 0;

Check failure on line 15 in sacro-app/src/create-window.js

View workflow job for this annotation

GitHub Actions / check

Unexpected var, use let or const instead

Check failure on line 15 in sacro-app/src/create-window.js

View workflow job for this annotation

GitHub Actions / check

'start' is assigned a value but never used
var end = x.length - 1;

Check failure on line 16 in sacro-app/src/create-window.js

View workflow job for this annotation

GitHub Actions / check

Unexpected var, use let or const instead
while (characters.indexOf(x[end]) >= 0) {
end -= 1;
}
return x.substr(0, end + 1);
}

const createWindow = async () => {
let serverUrl = process.env.SACRO_URL;
let serverProcess = null;
Expand All @@ -21,6 +30,9 @@ const createWindow = async () => {
serverProcess = server;
}

serverUrl = rtrim(serverUrl, '/')

Check failure on line 33 in sacro-app/src/create-window.js

View workflow job for this annotation

GitHub Actions / check

Replace `'/')⏎` with `"/");`


console.log(`Using ${serverUrl} as backend`);

// handle downloads
Expand Down

0 comments on commit b705e78

Please sign in to comment.