Skip to content

Conversation

@mhassan1
Copy link
Contributor

@mhassan1 mhassan1 commented Dec 5, 2025

This PR replaces the non-compliant DATA_URL_PATTERN regular expression in fromDataURI with the data-uri-to-buffer library, which is compliant with RFC 2397.

Before this change, the following valid Data URIs resulted in Invalid URL:

  • data:;base64,MTIz
  • data:application/octet-stream,123
  • data:text/plain;charset=US-ASCII,123

It uses data-uri-to-buffer@3, which supports Node.js 6+.

@mhassan1 mhassan1 force-pushed the data-uri-rfc-2397 branch 3 times, most recently from 5b8e04c to 0aac668 Compare December 5, 2025 19:14
@mhassan1 mhassan1 changed the title feat: parse data uris according to rfc 2397 fix: parse data uris according to rfc 2397 Dec 5, 2025
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.

1 participant