Don't print Bridge lines in torrc for blank lines

This commit is contained in:
Micah Lee 2021-10-19 08:50:33 -07:00
parent 1f5dcd1689
commit 3aa7902695
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -337,14 +337,16 @@ class Onion(object):
for line in self.settings.get("tor_bridges_use_moat_bridges").split(
"\n"
):
f.write(f"Bridge {line}\n")
if line.strip() != "":
f.write(f"Bridge {line}\n")
f.write("\nUseBridges 1\n")
elif self.settings.get("tor_bridges_use_custom_bridges"):
for line in self.settings.get(
"tor_bridges_use_custom_bridges"
).split("\n"):
f.write(f"Bridge {line}\n")
if line.strip() != "":
f.write(f"Bridge {line}\n")
f.write("\nUseBridges 1\n")
# Execute a tor subprocess