Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function process (params, cb) {
var headers = Hash.copy(params.headers || {});
if (Hash.size(self.cookies)) {
headers.cookie = qs.stringify(Hash.map(
self.cookies,
function (c) { return c.value }
));
}
if (params.method == 'POST') {
if (params.body && !headers['Content-Type']) {
headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
if (!Array.isArray(params.body) && typeof params.body == 'object') {
params.body = qs.stringify(params.body);
}
}
request(