google / osv.dev

Open source vulnerability DB and triage service.
https://osv.dev
Apache License 2.0
1.54k stars 188 forks source link

fix: Set `last_update_date` to the time reported by the REST endpoint #2672

Closed michaelkedar closed 1 month ago

michaelkedar commented 1 month ago

Use the Last-Modified header (or the latest modified vuln date if the header is missing) to set the REST SourceRepository's last_update_date, instead of using the time when the importer ran.

Should alleviate #2670 for well-behaved REST sources, though it still doesn't handle cases where the source itself adds a record with date before the previous updated date.

While I was here, I also tidied up the ignore_last_import_time logic a bit (because the long line splitting was annoying).