From 528a424543aa9c439b72392d232baedd41ceeb84 Mon Sep 17 00:00:00 2001 From: German Gutierrez Date: Mon, 1 Aug 2022 10:26:38 +0200 Subject: [PATCH] adding path to url sanitizeURL --- powerdns/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powerdns/client.go b/powerdns/client.go index 14d8817..fb507ce 100644 --- a/powerdns/client.go +++ b/powerdns/client.go @@ -81,6 +81,7 @@ func sanitizeURL(URL string) (string, error) { cleanURL := "" host := "" schema := "" + path := "" var err error @@ -121,7 +122,11 @@ func sanitizeURL(URL string) (string, error) { host = parsedURL.Host } - cleanURL = schema + "://" + host + if len(parsedURL.Path) > 0 { + path = parsedURL.Path + } + + cleanURL = schema + "://" + host + path return cleanURL, nil }