Skip to content

Commit

Permalink
chg: [views] Improved the function which is generating the ATOM feed …
Browse files Browse the repository at this point in the history
…for the CVEs.
  • Loading branch information
cedricbonhomme committed Nov 28, 2023
1 parent 208c0d3 commit 5823fad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion freshermeat/web/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import logging
import os
from datetime import timezone
from urllib.parse import urljoin

from feedgen.feed import FeedGenerator
from flask import current_app
Expand Down Expand Up @@ -125,7 +126,9 @@ def recent_cves():
fe.id(cve.cve_id)
fe.title(f"{cve.project.name} - {cve.cve_id}")
fe.description(cve.summary)
fe.link(href="https://cvepremium.circl.lu/cve/" + cve.cve_id)
fe.link(
href=urljoin(application.config["CVE_SEARCH_INSTANCE"], f"cve/{cve.cve_id}")
)
fe.updated(cve.published_at.replace(tzinfo=timezone.utc))
fe.published(cve.published_at.replace(tzinfo=timezone.utc))
atomfeed = fg.atom_str(pretty=True)
Expand Down

0 comments on commit 5823fad

Please sign in to comment.