node_modules: update (#325)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurla
2026-09-25 18:42:41 +02:00
committed by GitHub
parent bd35283f19
commit 6d91308e46
19 changed files with 300 additions and 79 deletions
+12 -5
View File
@@ -126,11 +126,18 @@ class MessageParser extends node_stream_1.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