Skip to content

Commit a9462dc

Browse files
fix(main) respect other url prefixes
1 parent 2bb676e commit a9462dc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const WINDOW_POSITION = process.env.WINDOW_POSITION || "0,0";
1818
const PERSISTENT_DATA = process.env.PERSISTENT || "0";
1919
const REMOTE_DEBUG_PORT = process.env.REMOTE_DEBUG_PORT || 35173;
2020
const FLAGS = process.env.FLAGS || null;
21-
const HTTPS_REGEX = /^https?:\/\//i; //regex for HTTP/S prefix
21+
const PROTOCOL_REGEX = /^[a-zA-Z0-9-]+:\/\//i; // regex for any protocol prefix
2222

2323
// Environment variables which can be overriden from the API
2424
let kioskMode = process.env.KIOSK || "0";
@@ -44,7 +44,8 @@ async function getUrlToDisplayAsync() {
4444

4545
// Prepend http:// if the LAUNCH_URL doesn't have it.
4646
// This is needed for the --app flag to be used for kiosk mode
47-
if (!HTTPS_REGEX.test(launchUrl)) {
47+
48+
if (!PROTOCOL_REGEX.test(launchUrl)) {
4849
launchUrl = `http://${launchUrl}`;
4950
}
5051

0 commit comments

Comments
 (0)