mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Search for index.txt and changes.csv in csaf folder, too.
This commit is contained in:
parent
deaf8a5722
commit
68cab9ec58
1 changed files with 22 additions and 13 deletions
|
|
@ -471,8 +471,11 @@ func (p *processor) checkIndex(base string, mask whereType) error {
|
|||
return errContinue
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
// It's optional
|
||||
if res.StatusCode != http.StatusNotFound {
|
||||
p.badIndex("Fetching %s failed. Status code %d (%s)",
|
||||
index, res.StatusCode, res.Status)
|
||||
}
|
||||
return errContinue
|
||||
}
|
||||
|
||||
|
|
@ -503,8 +506,11 @@ func (p *processor) checkChanges(base string, mask whereType) error {
|
|||
return errContinue
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
if res.StatusCode != http.StatusNotFound {
|
||||
// It's optional
|
||||
p.badChange("Fetching %s failed. Status code %d (%s)",
|
||||
changes, res.StatusCode, res.Status)
|
||||
}
|
||||
return errContinue
|
||||
}
|
||||
|
||||
|
|
@ -587,20 +593,23 @@ func (p *processor) checkCSAFs(domain string) error {
|
|||
var feeds [][]csaf.Feed
|
||||
if err := util.ReMarshalJSON(&feeds, rolie); err != nil {
|
||||
p.badProviderMetadata("ROLIE feeds are not compatible: %v.", err)
|
||||
goto noRolie
|
||||
}
|
||||
if err := p.processFeeds(domain, feeds); err != nil {
|
||||
if err == errContinue {
|
||||
goto noRolie
|
||||
}
|
||||
} else if err := p.processFeeds(domain, feeds); err != nil {
|
||||
if err != errContinue {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
noRolie:
|
||||
}
|
||||
|
||||
// No rolie feeds
|
||||
// TODO: Implement me!
|
||||
base := "https://" + domain + "/.well-known/csaf"
|
||||
|
||||
if err := p.checkIndex(base, indexMask); err != nil && err != errContinue {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := p.checkChanges(base, changesMask); err != nil && err != errContinue {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue