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

Commit 0a727f6

Browse files
authored
Merge pull request #8 from MuffinK/master
Update check.js
2 parents 32e0177 + 5f5f52a commit 0a727f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/check.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const rest = (options, callback) => {
9696
};
9797

9898
// build url
99-
let apiUrl = `https://api.github.com/repos/${options.owner}/${options.repo}`;
99+
let apiUrl = `/repos/${options.owner}/${options.repo}`;
100100
if (options.fetchTags) {
101101
apiUrl += '/tags';
102102
} else {
@@ -109,14 +109,16 @@ const rest = (options, callback) => {
109109

110110
// define request options
111111
const opts = {
112+
hostname: 'api.github.com',
113+
path: apiUrl,
112114
headers: {
113115
'Accept': 'application/vnd.github.v3+json',
114116
'User-Agent': `${pkg.name} v${pkg.version}`
115117
}
116118
};
117119

118120
// execute request
119-
let req = https.get(apiUrl, opts, handler);
121+
let req = https.get(opts, handler);
120122
req.on('error', err => {
121123
callback(err, null);
122124
});

0 commit comments

Comments
 (0)