[search] Reconcile diverged content.py (#784) #845

Closed
sleepy wants to merge 0 commits from fix/dedup-search-content-784 into main
Owner

Problem

services/search/content.py and src/search/content.py were diverged copies (issue #784). The services/ version was missing security improvements.

Fix

Replace services/search/content.py with re-exports from canonical src.search.content.

Testing

  • 66/66 security regression tests pass
  • 528/528 non-pre-existing tests pass
## Problem services/search/content.py and src/search/content.py were diverged copies (issue #784). The services/ version was missing security improvements. ## Fix Replace services/search/content.py with re-exports from canonical src.search.content. ## Testing - 66/66 security regression tests pass - 528/528 non-pre-existing tests pass
services/search/content.py was a stale copy of src/search/content.py
missing several security improvements:

- _is_private_address did not check addr.is_link_local
- _resolve_hostname_ips did not filter by socket family
- _public_http_url returned True for hostnames with empty DNS
  resolution instead of failing closed
- _get_public_url used bare httpx.get() without connection reuse
- Missing _extract_og_image, thin-content fallback, og_image in result

Replace services/search/content.py with a re-export module that
delegates to the canonical src.search.content implementation.
sleepy closed this pull request 2026-06-04 11:42:21 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.