mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +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
|
||||
}
|
||||
|
||||
// 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()
|
||||
s512 := sha512.New()
|
||||
data.Reset()
|
||||
|
|
|
|||
|
|
@ -281,6 +281,13 @@ func (d *downloader) downloadFiles(label csaf.TLPLabel, files []csaf.AdvisoryFil
|
|||
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 (
|
||||
writers []io.Writer
|
||||
s256, s512 hash.Hash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue