Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parse_multipart: function(payload, boundary) {
var parts = []
var part
var data
var headers = []
var curr_header_name
var curr_header_value
var parser = new MultipartParser()
parser.initWithBoundary(boundary)
parser.onPartBegin = function() {
part = {}
headers = []
curr_header_name = ""
curr_header_value = ""
data = new Buffer('')
}
parser.onHeaderField = function(b, start, end) {
curr_header_name = b.slice(start, end).toString()
};
parser.onHeaderValue = function(b, start, end) {
curr_header_value = b.slice(start, end).toString()