summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomasz1986 <twilczynski@naver.com>2022-09-27 19:57:48 +0200
committerGitHub <noreply@github.com>2022-09-27 19:57:48 +0200
commitb39985483dffd352e1606d9551995234a67ebf51 (patch)
treeeae2c9bd8ce62231ebe4b22384986d0f322d5414
parentf38df0dadb03a61f8eddf602d1b404628d702a63 (diff)
gui: Filter scope ID out of IPv6 addresses in Remote GUI (fixes #8084) (#8559)
Currently, the link to remote GUI uses device addresses as they are advertised from the router. Because of this, they may end up having a scope ID attached to them. The problem is that browsers do not support such addresses, leaving the user with a non-working URL. Because of the above, use regex to simply filter out the scope ID from the address before using it for Remote GUI. Signed-off-by: Tomasz WilczyƄski <twilczynski@naver.com>
-rwxr-xr-xgui/default/syncthing/core/syncthingController.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 8b998a1428..de5d326593 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -1202,7 +1202,8 @@ angular.module('syncthing.core')
$scope.remoteGUIAddress = function (deviceCfg) {
// Assume hasRemoteGUIAddress is true or we would not be here
var conn = $scope.connections[deviceCfg.deviceID];
- return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort);
+ // Use regex to filter out scope ID from IPv6 addresses.
+ return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace('%.*?\]:', ']:');
};
function replaceAddressPort(address, newPort) {