Skip to content

Commit

Permalink
ubuntu: check validator on 200 response
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Mar 3, 2022
1 parent 243f329 commit c8ee8b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ubuntu/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ func (u *Updater) Fetch(ctx context.Context, fingerprint driver.Fingerprint) (io

switch resp.StatusCode {
case http.StatusOK:
zlog.Info(ctx).Msg("fetching latest oval database")
if fp := string(fingerprint); fp == "" || fp != resp.Header.Get("etag") {
zlog.Info(ctx).Msg("fetching latest oval database")
break
}
fallthrough
case http.StatusNotModified:
return nil, fingerprint, driver.Unchanged
default:
Expand Down

0 comments on commit c8ee8b9

Please sign in to comment.