Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// https://tools.ietf.org/html/rfc5849#section-3.4.1.3.1
if ((!options || !options.headers ||
options.headers['Content-Type'] === 'application/x-www-form-urlencoded') &&
options.data) {
params = xtend(params, ohauth.stringQs(options.data));
}
params.oauth_token = token('oauth_token');
params.oauth_signature = ohauth.signature(
o.oauth_secret,
oauth_token_secret,
ohauth.baseString(method, canonical_url, params));
xhr.setRequestHeader( "Authorization", 'OAuth ' + ohauth.authHeader(params) );
}