Verified Commit acd3d920 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in...

fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection

Bug 41802: Improve the regex on parseBridgeLine

The previous version of the regex took for granted the bridge
fingerprint was always available, but it is actually optional.
So, parsing some bridge lines (e.g., Conjure) failed, and vanilla
bridge was displayed instead of the actual transport.
parent 8f5d81f5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1176,7 +1176,7 @@ function makeBridgeId(bridgeString) {
}

function parseBridgeLine(line) {
  const re = /^([^\s]+\s+)?([0-9a-fA-F\.\[\]\:]+:[0-9]{1,5})\s*([0-9a-fA-F]{40})(\s+.+)?/;
  const re = /^\s*(\S+\s+)?([0-9a-fA-F\.\[\]\:]+:\d{1,5})(\s+[0-9a-fA-F]{40})?(\s+.+)?/;
  const matches = line.match(re);
  if (!matches) {
    return null;
@@ -1186,7 +1186,7 @@ function parseBridgeLine(line) {
    bridge.transport = matches[1].trim();
  }
  if (matches[3] !== undefined) {
    bridge.id = matches[3].toUpperCase();
    bridge.id = matches[3].trim().toUpperCase();
  }
  if (matches[4] !== undefined) {
    bridge.args = matches[4].trim();