Skip to content

Commit

Permalink
Merge branch 'decode-uri' of github.com:pankdm/web-worker into pankdm…
Browse files Browse the repository at this point in the history
…-decode-uri
  • Loading branch information
developit committed Jan 31, 2025
2 parents e928902 + 990604c commit 00ddf0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ function evaluateDataUrl(url, name) {
function parseDataUrl(url) {
let [m, type, encoding, data] = url.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/) || [];
if (!m) throw Error('Invalid Data URL.');
data = decodeURIComponent(data);
if (encoding) switch (encoding.toLowerCase()) {
case 'base64':
data = Buffer.from(data, 'base64').toString();
Expand Down

0 comments on commit 00ddf0c

Please sign in to comment.