Skip to content

fix: guard enclosure against None/non-positive length values - #457

Open
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/enclosure-length-guard
Open

fix: guard enclosure against None/non-positive length values#457
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/enclosure-length-guard

Conversation

@Zerthick

Copy link
Copy Markdown

Description

Guard <enclosure> element against None or non-positive length values in the RSS feed.

When a remote image returns 404, the length field becomes None, which would produce invalid XML like <enclosure length="None" />. This PR adds a guard to skip the enclosure element when length is None or non-positive.

Changes

  • Add guard condition in rss.xml.jinja2 template: check that item.image[2] is not None and is greater than 0
  • Add test verifying no invalid enclosure length values in output

Split from: #451


💡 AI Contribution Level: 8 — Based on the VisiData AI contribution scale, this was an AI-assisted contribution where the AI performed the code splitting and PR creation with minimal human guidance.

When a remote image returns 404, the length field becomes None,
producing invalid XML. Added guard to skip enclosure when length
is None or non-positive.

- Add guard condition in rss.xml.jinja2 template
- Add test verifying no invalid enclosure length values
@github-actions github-actions Bot added bug Something isn't working quality Tests, project resiliency, etc. labels Aug 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quality Tests, project resiliency, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant