Skip to content

Commit

Permalink
epss: fix config contract break
Browse files Browse the repository at this point in the history
Signed-off-by: daynewlee <[email protected]>
  • Loading branch information
daynewlee committed Nov 25, 2024
1 parent bccaab1 commit b0fb5bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions enricher/epss/epss.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func (e *Enricher) FetchEnrichment(ctx context.Context, _ driver.Fingerprint) (i
hint := driver.Fingerprint(newUUID.String())
zlog.Info(ctx).Str("hint", string(hint)).Msg("starting fetch")

if e.feedPath == "" || !strings.HasSuffix(e.feedPath, ".gz") {
return nil, "", fmt.Errorf("invalid feed path: %q must be non-empty and end with '.gz'", e.feedPath)
}

out, err := tmp.NewFile("", "epss.")
if err != nil {
return nil, hint, err
Expand All @@ -123,10 +127,6 @@ func (e *Enricher) FetchEnrichment(ctx context.Context, _ driver.Fingerprint) (i
}
}()

if e.feedPath == "" || !strings.HasSuffix(e.feedPath, ".gz") {
e.defaultURL()
}

req, err := http.NewRequestWithContext(ctx, http.MethodGet, e.feedPath, nil)
if err != nil {
return nil, "", fmt.Errorf("unable to create request for %s: %w", e.feedPath, err)
Expand Down

0 comments on commit b0fb5bf

Please sign in to comment.