dicer
dicer copied to clipboard
A very fast streaming multipart parser for node.js
Please find the link below for the git hub security alert. https://github.com/advisories/GHSA-wm7h-9275-46v2
Function `HeaderParser.prototype._parseHeader()` uses a variable `h`, which in edge cases is used before it is initialized. As a consequence the statement ```javascript this.header[h][this.header[h].length - 1] += lines[i]; ``` would crash....
Instead overriding `emit` method and using `this._realFinish` to detect unexpected end of data - implement `_final` method and track the logic there. The only behavior change from the use of...
Test case: ```js const { Readable } = require('stream'); const { pipeline } = require('stream/promises'); const Dicer = require('dicer'); async function main() { const r = new Readable({ read() {}...
If the multipart data like this: ``` POST /member.php?mod=register&inajax=1 HTTP/1.1 Host: domainExample Accept: text/html, application/xhtml+xml, */* Connection: Keep-Alive Content-Length: 522 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryzca7IDMnT6QwqBp7 Referer: http://domainExample/member.php?mod=register User-Agent: Mozilla/5.0 (compatible; MSIE 9.0;...
https://github.com/mscdex/dicer/issues/23#issue-1005300361
See https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files for details. Every little bit to improve cold start times.
TL;DR> The last part of a stream is discarded when a terminating boundary is missing. In the case when a Content-Length is known for the part (e.g. Motion JPEG streams...
It might be nice to add a comparison to [multipart-parser](https://www.npmjs.com/package/multipart-parser), which is a lot older but also claims insane speeds.