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:
parent
7cb376dd0e
commit
92f6bc5a31
1 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue