MCPcopy Index your code
hub / github.com/totaljs/framework / parse_multipart_header

Function parse_multipart_header

internal.js:334–364  ·  view source on GitHub ↗
(header)

Source from the content-addressed store, hash-verified

332}
333
334function parse_multipart_header(header) {
335
336 var arr = new Array(2);
337 var find = ' name="';
338 var length = find.length;
339 var beg = header.indexOf(find);
340 var tmp = '';
341
342 if (beg !== -1)
343 tmp = header.substring(beg + length, header.indexOf('"', beg + length));
344
345 if (tmp)
346 arr[0] = tmp;
347 else
348 arr[0] = 'undefined_' + (Math.floor(Math.random() * 100000)).toString();
349
350 find = ' filename="';
351 length = find.length;
352 beg = header.indexOf(find);
353 tmp = '';
354
355 if (beg !== -1)
356 tmp = header.substring(beg + length, header.indexOf('"', beg + length));
357
358 if (tmp)
359 arr[1] = tmp;
360 else
361 arr[1] = null;
362
363 return arr;
364}
365
366exports.routeSplit = function(url, noLower) {
367

Callers 1

internal.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected