From 3305d7b1db96731d0b90150b0cdc19dfcc74b4f1 Mon Sep 17 00:00:00 2001 From: mtardy Date: Sun, 22 Jan 2023 19:08:24 +0100 Subject: [PATCH] Check that the fetched feed is a JSON feed 1.1 and fail if not --- layouts/shortcodes/cve-feed.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/cve-feed.html b/layouts/shortcodes/cve-feed.html index 7c4aa2d56c2..887999305ab 100644 --- a/layouts/shortcodes/cve-feed.html +++ b/layouts/shortcodes/cve-feed.html @@ -1,5 +1,8 @@ +{{ $feed := getJSON .Site.Params.cveFeedBucket }} +{{ if ne $feed.version "https://jsonfeed.org/version/1.1" }} + {{ errorf "Build Failed. CVE feed does not comply with JSON feed v1.1" }} +{{ end }} - {{ $feed := getJSON .Site.Params.cveFeedBucket }}
{{ T "cve_table" }} {{ T "cve_table_date_before" }}{{ $feed._kubernetes_io.updated_at | time.Format ( T "cve_table_date_format" ) }}{{ T "cve_table_date_after" }}