|
| 1 | +export const EMAIL_HEADER_NAME_CASES = [ |
| 2 | + ["accepts RFC token characters", "X-Custom_Header.1", true], |
| 3 | + ["rejects spaces", "X Header", false], |
| 4 | + ["rejects colons", "X:Header", false], |
| 5 | + ["rejects an empty name", "", false], |
| 6 | +] as const; |
| 7 | + |
| 8 | +export const EMAIL_HEADER_VALUE_CASES = [ |
| 9 | + ["accepts plain text", "custom value", true], |
| 10 | + ["accepts LF-delimited lines", "first\nsecond", true], |
| 11 | + ["accepts CRLF-delimited lines", "first\r\nsecond", true], |
| 12 | + [ |
| 13 | + "accepts an injection-shaped line for safe folding", |
| 14 | + "safe\nBcc: victim@example.com", |
| 15 | + true, |
| 16 | + ], |
| 17 | + ["rejects a bare carriage return", "first\rsecond", false], |
| 18 | + ["rejects a tab", "first\tsecond", false], |
| 19 | + ["rejects DEL", "first\u007fsecond", false], |
| 20 | +] as const; |
| 21 | + |
| 22 | +export const MANAGED_EMAIL_HEADER_CASES = [ |
| 23 | + ["Bcc", true], |
| 24 | + ["Cc", true], |
| 25 | + ["Content-Transfer-Encoding", true], |
| 26 | + ["CONTENT-TYPE", true], |
| 27 | + ["Date", true], |
| 28 | + ["From", true], |
| 29 | + ["MIME-Version", true], |
| 30 | + ["Reply-To", true], |
| 31 | + ["Subject", true], |
| 32 | + ["mEsSaGe-Id", true], |
| 33 | + ["To", true], |
| 34 | + ["X-Custom-Header", false], |
| 35 | +] as const; |
0 commit comments