From a3751a77aad0463b028f515e8ca5586d705c79f7 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 19 May 2021 17:53:11 +0000 Subject: [PATCH] Fix: log custom port only if set (PIA, Windscribe) --- internal/configuration/privateinternetaccess.go | 4 +++- internal/configuration/windscribe.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/configuration/privateinternetaccess.go b/internal/configuration/privateinternetaccess.go index 91536410..e3a15388 100644 --- a/internal/configuration/privateinternetaccess.go +++ b/internal/configuration/privateinternetaccess.go @@ -22,7 +22,9 @@ func (settings *Provider) privateinternetaccessLines() (lines []string) { lines = append(lines, lastIndent+"Encryption preset: "+settings.ServerSelection.EncryptionPreset) - lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort))) + if settings.ServerSelection.CustomPort > 0 { + lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort))) + } if settings.PortForwarding.Enabled { lines = append(lines, lastIndent+"Port forwarding:") diff --git a/internal/configuration/windscribe.go b/internal/configuration/windscribe.go index fc0f931f..0a9a4325 100644 --- a/internal/configuration/windscribe.go +++ b/internal/configuration/windscribe.go @@ -19,7 +19,9 @@ func (settings *Provider) windscribeLines() (lines []string) { lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames)) } - lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort))) + if settings.ServerSelection.CustomPort > 0 { + lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort))) + } return lines }