From 92f6bc5a3132d703399c941e56e8b04cf6246bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6felmeyer?= Date: Mon, 25 Jul 2022 08:25:06 +0200 Subject: [PATCH] fixes missing negation of condition and fixes error messages --- cmd/csaf_uploader/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/csaf_uploader/main.go b/cmd/csaf_uploader/main.go index 96db093..5df2bc6 100644 --- a/cmd/csaf_uploader/main.go +++ b/cmd/csaf_uploader/main.go @@ -304,12 +304,12 @@ func (p *processor) process(filename string) error { } // We expect a JSON answer so all other is not valid. - if strings.Contains(resp.Header.Get("Content-Type"), "application/json") { + if !strings.Contains(resp.Header.Get("Content-Type"), "application/json") { var sb strings.Builder if _, err := io.Copy(&sb, resp.Body); err != nil { - return fmt.Errorf("reading none JSON reply from server failed: %v", err) + return fmt.Errorf("reading non-JSON reply from server failed: %v", err) } - return fmt.Errorf("none JSON replay: %v", sb.String()) + return fmt.Errorf("non-JSON reply from server: %v", sb.String()) } var result struct {