fix(custom): do not set server name if it does not exist

This commit is contained in:
Quentin McGaw
2024-05-01 19:35:40 +00:00
parent 7e0738d113
commit b25ee21e3e

View File

@@ -52,12 +52,11 @@ func getOpenVPNConnection(extractor Extractor,
func getWireguardConnection(selection settings.ServerSelection) ( func getWireguardConnection(selection settings.ServerSelection) (
connection models.Connection) { connection models.Connection) {
connection = models.Connection{ connection = models.Connection{
Type: vpn.Wireguard, Type: vpn.Wireguard,
IP: selection.Wireguard.EndpointIP, IP: selection.Wireguard.EndpointIP,
Port: *selection.Wireguard.EndpointPort, Port: *selection.Wireguard.EndpointPort,
Protocol: constants.UDP, Protocol: constants.UDP,
PubKey: selection.Wireguard.PublicKey, PubKey: selection.Wireguard.PublicKey,
ServerName: selection.Names[0],
} }
if len(selection.Names) > 0 { if len(selection.Names) > 0 {
// Set the server name for PIA port forwarding code used // Set the server name for PIA port forwarding code used