mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Fix year folder check (#472)
This commit is contained in:
parent
1cc42f0ec0
commit
716f128754
3 changed files with 72 additions and 6 deletions
|
|
@ -33,6 +33,7 @@ import (
|
|||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/csaf-poc/csaf_distribution/v3/csaf"
|
||||
"github.com/csaf-poc/csaf_distribution/v3/internal/models"
|
||||
"github.com/csaf-poc/csaf_distribution/v3/util"
|
||||
)
|
||||
|
||||
|
|
@ -666,12 +667,9 @@ func (p *processor) integrity(
|
|||
var folderYear *int
|
||||
if m := yearFromURL.FindStringSubmatch(u); m != nil {
|
||||
year, _ := strconv.Atoi(m[1])
|
||||
// Check if we are in checking time interval.
|
||||
if accept := p.cfg.Range; accept != nil && !accept.Contains(
|
||||
time.Date(
|
||||
year, 12, 31, // Assume last day of year.
|
||||
23, 59, 59, 0, // 23:59:59
|
||||
time.UTC)) {
|
||||
// Check if the year is in the accepted time interval.
|
||||
if accept := p.cfg.Range; accept != nil &&
|
||||
!accept.Intersects(models.Year(year)) {
|
||||
continue
|
||||
}
|
||||
folderYear = &year
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue