@travetto/email 5.0.12 → 5.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +4 -4
  3. package/src/util.ts +3 -2
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 ArcSine Technologies
3
+ Copyright (c) 2020 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email",
3
- "version": "5.0.12",
3
+ "version": "5.0.14",
4
4
  "description": "Email transmission module.",
5
5
  "keywords": [
6
6
  "email",
@@ -23,9 +23,9 @@
23
23
  "directory": "module/email"
24
24
  },
25
25
  "dependencies": {
26
- "@travetto/config": "^5.0.12",
27
- "@travetto/di": "^5.0.12",
28
- "@travetto/runtime": "^5.0.12",
26
+ "@travetto/config": "^5.0.14",
27
+ "@travetto/di": "^5.0.14",
28
+ "@travetto/runtime": "^5.0.14",
29
29
  "@types/mustache": "^4.2.5",
30
30
  "mustache": "^4.2.0"
31
31
  },
package/src/util.ts CHANGED
@@ -8,7 +8,7 @@ import { EmailAttachment, EmailIdentity, EmailIdentityList, EmailOptions } from
8
8
  export class MailUtil {
9
9
  /** Remove brand from text */
10
10
  static purgeBrand(text: string): string {
11
- return text.replace(/<!-- WARNING:[^\n]*\n/m, '');
11
+ return text.replace(/<!-- WARNING:[^\n]{0,500}\n/m, '');
12
12
  }
13
13
 
14
14
  /** Add brand to text */
@@ -31,7 +31,8 @@ export class MailUtil {
31
31
  const attachments: EmailAttachment[] = [];
32
32
  const contentMap = new Map<string, string>();
33
33
 
34
- html = html.replace(/data:(image\/[^;]+);base64,([^"']+)/g, (__, contentType, content) => {
34
+ // Max of 10mb
35
+ html = html.replace(/data:(image\/[^;]{1,50});base64,([^"']{1,10000000})/g, (__, contentType, content) => {
35
36
  // Ensure same data uris map to a single cid
36
37
  if (!contentMap.has(content)) {
37
38
  const cid = `image-${idx += 1}`;