1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

fixes missing negation of condition and fixes error messages

This commit is contained in:
Jan Höfelmeyer 2022-07-25 08:25:06 +02:00
parent 7cb376dd0e
commit 92f6bc5a31

View file

@ -304,12 +304,12 @@ func (p *processor) process(filename string) error {
} }
// We expect a JSON answer so all other is not valid. // 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 var sb strings.Builder
if _, err := io.Copy(&sb, resp.Body); err != nil { 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 { var result struct {