From ea5195169691019abf48da8f24912a9570018954 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Tue, 13 Dec 2016 14:52:11 +0100 Subject: [PATCH] prefix url with http. --- static/js/captiveportal.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/captiveportal.js b/static/js/captiveportal.js index 1105435..4ee45c4 100644 --- a/static/js/captiveportal.js +++ b/static/js/captiveportal.js @@ -25,6 +25,11 @@ var getUrlParameter = function getUrlParameter(sParam) { function do_success() { var url = getUrlParameter('url'); + // If url does not start with http the window.location redirect + // won't work. So prefix http to url. + if (!url.startsWith('http')) { + url = 'http://'+url; + } console.log('success: '+url); // Do something like refresh the window or go to another URL.