From 067e07929353c70eb4c43a3c596fe52a7ddf7ccd Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 12 Mar 2025 20:37:57 -0400 Subject: [PATCH] Handle / better --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 7618d3b..f585222 100644 --- a/main.go +++ b/main.go @@ -214,6 +214,9 @@ func resolveDomain(domain string) (string, error) { host = strings.TrimPrefix(host, "https://") } + // if there are any trailing slashes, remove them + host = strings.TrimSuffix(host, "/") + // Lookup IP addresses ips, err := net.LookupIP(host) if err != nil { @@ -354,6 +357,8 @@ func main() { host = strings.TrimPrefix(host, "https://") } + host = strings.TrimSuffix(host, "/") + // Create WireGuard service wgService, err = wg.NewWireGuardService(interfaceName, mtuInt, generateAndSaveKeyTo, host, id, client) if err != nil {