mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-09-29 12:28:07 +07:00
node_modules: update (#325)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
+12
-5
@@ -124,11 +124,18 @@ export default class MessageParser extends Transform {
|
||||
// signature covers exactly the bytes the receiving side canonicalizes
|
||||
// Only SP and HTAB fold a line, and only they are trimmed from the field name, the
|
||||
// same whitespace the relaxed canonicalization in sign.ts works with
|
||||
const lines = (this.rawHeaders || Buffer.alloc(0)).toString('binary').split(/\r?\n/);
|
||||
for (let i = lines.length - 1; i > 0; i--) {
|
||||
if (/^[ \t]/.test(lines[i])) {
|
||||
lines[i - 1] += '\n' + lines[i];
|
||||
lines.splice(i, 1);
|
||||
const rawLines = (this.rawHeaders || Buffer.alloc(0)).toString('binary').split(/\r?\n/);
|
||||
// Unfold in a single forward pass and only ever test a freshly split line for the
|
||||
// continuation prefix. Testing an already merged line instead would rescan a string
|
||||
// that grows with every continuation line, so a header folded into many continuation
|
||||
// lines (a large recipient list, for example) would take quadratic time to unfold
|
||||
const lines = [];
|
||||
for (const rawLine of rawLines) {
|
||||
if (lines.length && /^[ \t]/.test(rawLine)) {
|
||||
lines[lines.length - 1] += '\n' + rawLine;
|
||||
}
|
||||
else {
|
||||
lines.push(rawLine);
|
||||
}
|
||||
}
|
||||
return lines
|
||||
|
||||
Reference in New Issue
Block a user