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

Method writeHeaders

src/Formidable.js:265–284  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

263 }
264
265 async writeHeaders(headers) {
266 this.headers = headers;
267 this._parseContentLength();
268 await this._parseContentType();
269
270 if (!this._parser) {
271 this._error(
272 new FormidableError(
273 'no parser found',
274 errors.noParser,
275 415, // Unsupported Media Type
276 ),
277 );
278 return;
279 }
280
281 this._parser.once('error', (error) => {
282 this._error(error);
283 });
284 }
285
286 write(buffer) {
287 if (this.error) {

Callers 2

parseMethod · 0.95

Calls 3

_parseContentLengthMethod · 0.95
_parseContentTypeMethod · 0.95
_errorMethod · 0.95

Tested by

no test coverage detected