From 0a28c45a6cb885feeb14a49cba2c9b956bda665a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 1 Nov 2024 08:30:55 -0500 Subject: [PATCH] import worked Signed-off-by: Jeff Carr --- importDomain.go | 7 +++++-- post.go | 8 -------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/importDomain.go b/importDomain.go index 3e07eb5..98f506b 100644 --- a/importDomain.go +++ b/importDomain.go @@ -88,14 +88,17 @@ func importDomain(w http.ResponseWriter, r *http.Request) (string, error) { log.Info(reason) return "", err } - log.Warn("bad XML:", s) - os.Exit(0) + if s != "" { + log.Warn("bad XML:", s) + os.Exit(0) + } // everything worked. add the events for _, e := range events { me.cluster.AddEvent(e) } + log.Warn("Everything worked") result := fmt.Sprintln("importDomain() worked") log.Log(WARN, result) fmt.Fprintln(w, result) diff --git a/post.go b/post.go index 8e56b75..5462ee3 100644 --- a/post.go +++ b/post.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "os/user" - "strings" "go.wit.com/log" ) @@ -35,12 +34,5 @@ func httpPost(url string, data []byte) ([]byte, error) { log.Error(err) return body, err } - - test := strings.TrimSpace(string(body)) - log.Info("go.wit.com returned body:", test) - if test == "OK" { - return body, nil - } - return body, nil }