@zone-eu/mailsplit 5.4.23 → 5.4.24
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.
- package/lib/headers.js +10 -4
- package/package.json +1 -1
package/lib/headers.js
CHANGED
|
@@ -365,10 +365,16 @@ class Headers {
|
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
let
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
let raw = this.headers.toString('binary');
|
|
369
|
+
|
|
370
|
+
// Trailing line breaks go with an index scan. /[\r\n]+$/ retried a run of carriage
|
|
371
|
+
// returns from every position in it, quadratic on a header line made of them
|
|
372
|
+
let end = raw.length;
|
|
373
|
+
while (end > 0 && (raw.charCodeAt(end - 1) === 0x0a || raw.charCodeAt(end - 1) === 0x0d)) {
|
|
374
|
+
end--;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
let rawLines = raw.slice(0, end).split(/\r?\n/);
|
|
372
378
|
|
|
373
379
|
// Single forward pass. Splicing folded lines out of the source array in place was
|
|
374
380
|
// quadratic on a header block with many continuation lines.
|