MCPcopy
hub / github.com/node-formidable/formidable / _parseContentLength

Method _parseContentLength

src/Formidable.js:503–514  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

501 }
502
503 _parseContentLength() {
504 this.bytesReceived = 0;
505 if (this.headers['content-length']) {
506 this.bytesExpected = parseInt(this.headers['content-length'], 10);
507 } else if (this.headers['transfer-encoding'] === undefined) {
508 this.bytesExpected = 0;
509 }
510
511 if (this.bytesExpected !== null) {
512 this.emit('progress', this.bytesReceived, this.bytesExpected);
513 }
514 }
515
516 _newParser() {
517 return new MultipartParser(this.options);

Callers 2

writeHeadersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected