Skip to content

Commit

Permalink
[api] Specify user-agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 16, 2013
1 parent 68b547a commit 2d9d40a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/jitsu.js
Expand Up @@ -263,6 +263,11 @@ jitsu.setup = function (callback) {
jitsu.config.set('rejectUnauthorized', false);
}

var userAgent = jitsu.config.get('headers:user-agent');
if (!userAgent) {
jitsu.config.set('headers:user-agent', 'jitsu/' + jitsu.version);
}

['Users', 'Apps', 'Snapshots', 'Databases', 'Logs', 'Tokens'].forEach(function (key) {
var k = key.toLowerCase();
jitsu[k] = new jitsu.api[key](jitsu.config);
Expand Down

0 comments on commit 2d9d40a

Please sign in to comment.