Skip to content

Recover inline base64 data missing data: scheme prefix - #421

Open
Sriram-Nambiar wants to merge 1 commit into
openzim:mainfrom
Sriram-Nambiar:issue420_missing_data_prefix
Open

Sriram-Nambiar wants to merge 1 commit into
openzim:mainfrom
Sriram-Nambiar:issue420_missing_data_prefix

Conversation

@Sriram-Nambiar

Copy link
Copy Markdown
Contributor

Inline base64 payloads missing their data: prefix were treated as regular relative or HTTP URLs, breaking images, links, and CSS references. Detect these malformed values before URL resolution, strip any fake prefix and stray payload whitespace, and prepend data: instead of normalizing them as ZIM paths. Also skip recording original attributes for data: URLs, avoid module notifications for inline scripts, and prevent srcset splitting on commas inside inline data URIs.

Follow-up from openzim/warc2zim#472.

Closes #420

# Conflicts:
#	src/zimscraperlib/rewriting/url_rewriting.py
#	tests/rewriting/test_css_rewriting.py
#	tests/rewriting/test_url_rewriting.py
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0f8b295) to head (7bee36b).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #421   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         2990      3073   +83     
  Branches       457       482   +25     
=========================================
+ Hits          2990      3073   +83     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

Detect and recover malformed inline data URLs missing the data: scheme

1 participant