Skip to content

Improve Solr connection error handling and improve HTML sanitization#61

Merged
jguo144 merged 2 commits into
release-v2.9.11-opengov-py3.11from
jguo144/2026-05-08/patch
May 11, 2026
Merged

Improve Solr connection error handling and improve HTML sanitization#61
jguo144 merged 2 commits into
release-v2.9.11-opengov-py3.11from
jguo144/2026-05-08/patch

Conversation

@jguo144
Copy link
Copy Markdown
Collaborator

@jguo144 jguo144 commented May 11, 2026

Description

Improves error handling for Solr connection failures and improve HTML sanitization in markdown rendering.

Changes

Search error handling

  • Add SolrConnectionError exception type for connection-specific failures
  • Detect Solr connection errors in PackageSearchQuery and raise appropriate exception
  • Return 500 status with clear "Search Connection Error" message in API and dataset views
  • Add test coverage for connection error scenarios

HTML sanitization

  • Replace regex-based RE_MD_HTML_TAGS pattern with bleach_clean(strip=True)
  • Ensures consistent and secure HTML stripping in markdown_extract() and render_markdown()
  • Update test expectations to reflect improved sanitization behavior

Upstream Commits

amercader added 2 commits May 11, 2026 16:47
[2.10] Fix for Solr connection errors leaking details
helpers: strip tags with bleach only
Copy link
Copy Markdown

@orca-security-us orca-security-us Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@jguo144 jguo144 enabled auto-merge May 11, 2026 22:04
@jguo144 jguo144 merged commit ad86a00 into release-v2.9.11-opengov-py3.11 May 11, 2026
1 check passed
@jguo144 jguo144 deleted the jguo144/2026-05-08/patch branch May 11, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants