Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b4b80eb

Browse files
committed
Add header to the request if we have the token
1 parent 64e1262 commit b4b80eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

octorun/src/bin/app-usage.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var commander = require("commander");
22
var package = require('../../package.json')
3+
var config = require("../configuration");
34
var endOfLine = require('os').EOL;
45
var fs = require('fs');
56
var util = require('util');
@@ -45,6 +46,9 @@ if (fileContents && host) {
4546
'Content-Type': 'application/json'
4647
}
4748
};
49+
if (config.token) {
50+
options.headers['Authorization'] = 'token ' + config.token;
51+
}
4852

4953
var req = https.request(options, function (res) {
5054
var success = res.statusCode == 200;

0 commit comments

Comments
 (0)