Forráskód Böngészése

gui: Actually filter scope ID out of IPv6 address when using Remote GUI (ref #8084) (#9688)

gui: Actually filter scope ID out of IPv6 address when using Remote GUI
(ref #8084)

The current code does not work, because it uses a string in the
replace() method instead of regex. Thus, change it to a proper regex.

Signed-off-by: Tomasz Wilczyński <[email protected]>
tomasz1986 1 éve
szülő
commit
1baefea410
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      gui/default/syncthing/core/syncthingController.js

+ 1 - 1
gui/default/syncthing/core/syncthingController.js

@@ -1447,7 +1447,7 @@ angular.module('syncthing.core')
             // Assume hasRemoteGUIAddress is true or we would not be here
             var conn = $scope.connections[deviceCfg.deviceID];
             // Use regex to filter out scope ID from IPv6 addresses.
-            return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace('%.*?\]:', ']:');
+            return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace(/%.*?\]:/, ']:');
         };
 
         function replaceAddressPort(address, newPort) {