mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Warn in checker and downloader if advisories are delivered as none 'application/json'
This commit is contained in:
parent
052dbbe1d0
commit
6430712dad
2 changed files with 14 additions and 0 deletions
|
|
@ -467,6 +467,13 @@ func (p *processor) integrity(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warn if we do not get JSON.
|
||||||
|
if ct := res.Header.Get("Content-Type"); ct != "application/json" {
|
||||||
|
lg(WarnType,
|
||||||
|
"The content type of %s should be 'application/json but is '%s'",
|
||||||
|
u, ct)
|
||||||
|
}
|
||||||
|
|
||||||
s256 := sha256.New()
|
s256 := sha256.New()
|
||||||
s512 := sha512.New()
|
s512 := sha512.New()
|
||||||
data.Reset()
|
data.Reset()
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,13 @@ func (d *downloader) downloadFiles(label csaf.TLPLabel, files []csaf.AdvisoryFil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warn if we do not get JSON.
|
||||||
|
if ct := resp.Header.Get("Content-Type"); ct != "application/json" {
|
||||||
|
log.Printf(
|
||||||
|
"WARN: The content type of %s should be 'application/json but is '%s'\n",
|
||||||
|
file.URL(), ct)
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
writers []io.Writer
|
writers []io.Writer
|
||||||
s256, s512 hash.Hash
|
s256, s512 hash.Hash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue