Skip to content

Commit fea8c0b

Browse files
committed
Enable debugging of *github* dep
* Also at some point *node* changed the way to detect if debugging was in process. Updated original comment at OpenUserJS#429 (comment) Been a while since I've been in this mode for deep debug examination. * Fix missing custom headers for UA. This is optional but didn't know this until now that it had that option for the *github* dep. Post OpenUserJS#1753 Applies to OpenUserJS#1705 Ref(s): * https://nodejs.org/api/inspector.html#inspector_inspector_url * https://nodejs.org/api/debugger.html
1 parent a303691 commit fea8c0b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libs/debug.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
var inspector = require('inspector');
34
var fs = require('fs');
45
var os = require('os');
56

@@ -10,7 +11,7 @@ pkg.org = pkg.name.substring(0, pkg.name.indexOf('.'));
1011

1112
var isPro = process.env.NODE_ENV === 'production';
1213
var isDev = !isPro;
13-
var isDbg = typeof v8debug === 'object';
14+
var isDbg = typeof v8debug === 'object' || inspector.url();
1415

1516
var privkey = null;
1617
var fullchain = null;

libs/githubClient.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ var createOAuthAppAuth = require("@octokit/auth-oauth-app").createOAuthAppAuth;
1818

1919
// Client
2020
var github = new GitHubApi({
21-
version: "3.0.0"
21+
version: "3.0.0",
22+
debug: (isDbg ? true : false),
23+
headers: {
24+
"User-Agent": uaOUJS + (process.env.UA_SECRET ? ' ' + process.env.UA_SECRET : '')
25+
}
2226
});
2327
module.exports = github;
2428

0 commit comments

Comments
 (0)