google / osv.dev

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

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

Closed michaelkedar closed 8 hours ago

michaelkedar commented 4 days 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).