Fix to escape image URL before sending to the server

This commit is contained in:
iliajie
2023-06-05 00:35:51 +03:00
parent 37857ceeed
commit f694b01535

View File

@@ -2922,7 +2922,7 @@ my $iframe_body = <<EOF;
imgPresrc.forEach(function(img) {
(async function() {
try {
const response = await fetch("$webprefix/XHR.cgi?action=fetch&type=download&subtype=blob&url=" + img.dataset.presrc + "");
const response = await fetch("$webprefix/XHR.cgi?action=fetch&type=download&subtype=blob&url=" + encodeURIComponent(img.dataset.presrc) + "");
response.blob().then(function(blob) {
try {
const urlBlob = URL.createObjectURL(blob);