change images source in emails to base64

This commit is contained in:
Bernaldo Mihasi 2023-08-03 11:19:33 +03:00
parent 903026e2c2
commit b94aa51489
4 changed files with 8 additions and 5 deletions

View File

@ -108,8 +108,11 @@ public class MailServiceImpl implements MailService {
lastIndex = content.indexOf("img src=\"", lastIndex);
if (lastIndex != -1) {
imagePaths.add(content.substring(lastIndex + 9, content.indexOf("\"", lastIndex + 9)));
lastIndex ++;
String imagePath = content.substring(lastIndex + 9, content.indexOf("\"", lastIndex + 9));
if (!imagePath.contains("data:image/png;base64")) {
imagePaths.add(imagePath);
}
lastIndex++;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long