mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Properly handle path in CVE URL prefix (#4174)
This commit is contained in:
parent
d167556514
commit
c45115a915
3 changed files with 3 additions and 1 deletions
1
changes/fix-cve-url-prefix
Normal file
1
changes/fix-cve-url-prefix
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Properly handle paths in CVE URL prefix
|
||||
|
|
@ -36,6 +36,7 @@ func SyncCVEData(vulnPath string, config config.FleetConfig) error {
|
|||
return fmt.Errorf("parsing cve feed url prefix override: %w", err)
|
||||
}
|
||||
source.Host = parsed.Host
|
||||
source.CVEFeedPath = parsed.Path
|
||||
source.Scheme = parsed.Scheme
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ func TestSyncsCVEFromURL(t *testing.T) {
|
|||
|
||||
tempDir := t.TempDir()
|
||||
err := SyncCVEData(
|
||||
tempDir, config.FleetConfig{Vulnerabilities: config.VulnerabilitiesConfig{CVEFeedPrefixURL: ts.URL}})
|
||||
tempDir, config.FleetConfig{Vulnerabilities: config.VulnerabilitiesConfig{CVEFeedPrefixURL: ts.URL + "/feeds/json/cve/1.1/"}})
|
||||
require.Error(t, err)
|
||||
require.Equal(t,
|
||||
fmt.Sprintf("1 synchronisation error:\n\tunexpected size for \"%s/feeds/json/cve/1.1/nvdcve-1.1-2002.json.gz\" (200 OK): want 1453293, have 0", ts.URL),
|
||||
|
|
|
|||
Loading…
Reference in a new issue