MCPcopy Create free account
hub / github.com/pillarjs/multiparty / createMultipartBuffer

Function createMultipartBuffer

tool/bench-multipart-parser.js:58–69  ·  view source on GitHub ↗
(boundary, size)

Source from the content-addressed store, hash-verified

56});
57
58function createMultipartBuffer(boundary, size) {
59 var buffer = Buffer.alloc(size)
60 var head =
61 '--'+boundary+'\r\n' +
62 'content-disposition: form-data; name="field1"\r\n' +
63 '\r\n'
64 var tail = '\r\n--'+boundary+'--\r\n'
65
66 buffer.write(head, 'ascii', 0);
67 buffer.write(tail, 'ascii', buffer.length - tail.length);
68 return buffer;
69}
70
71function hijack(name, fn) {
72 var oldFn = form[name];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…