1
0
Fork 0
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:
Sascha L. Teichmann 2023-02-01 01:36:54 +01:00
parent 052dbbe1d0
commit 6430712dad
2 changed files with 14 additions and 0 deletions

View file

@ -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