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

Commit 3ac29c1

Browse files
author
Axel Rindle
committed
Remove reduceTraffic option
1 parent 7f8b345 commit 3ac29c1

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

examples/rest.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ const versionCheck = require('../lib/main');
22
const options = {
33
repo: 'github-version-checker',
44
owner: 'axelrindle',
5-
currentVersion: require('../package.json').version,
6-
reduceTraffic: false
5+
currentVersion: require('../package.json').version
76
};
87

98
versionCheck(options)

lib/check.js

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,12 @@ const rest = (options, callback) => {
8787
};
8888

8989
const apiUrl = `https://api.github.com/repos/${options.owner}/${options.repo}/releases`;
90-
let req;
91-
if (options.reduceTraffic) {
92-
const opts = {
93-
hostname: 'gvc-reduce-json.axelrindle.de',
94-
path: '/?url=' + apiUrl
95-
};
96-
req = https.get(opts, handler);
97-
} else {
98-
const opts = {
99-
headers: {
100-
'User-Agent': `${pkg.name} v${pkg.version}`
101-
}
102-
};
103-
req = https.get(apiUrl, opts, handler);
104-
}
90+
const opts = {
91+
headers: {
92+
'User-Agent': `${pkg.name} v${pkg.version}`
93+
}
94+
};
95+
let req = https.get(apiUrl, opts, handler);
10596
req.on('error', err => {
10697
callback(err, null);
10798
});
@@ -119,7 +110,9 @@ const rest = (options, callback) => {
119110
module.exports = (options, callback) => {
120111
// get options
121112
options.token = options.token || process.env.GITHUB_API_TOKEN || undefined;
122-
options.reduceTraffic = options.reduceTraffic !== undefined ? options.reduceTraffic : true;
113+
if (options.reduceTraffic) {
114+
console.warn('The "reduceTraffic" option is deprecated! Consider updating "github-version-checker" to a newer version.');
115+
}
123116

124117
// check if required options are defined
125118
if (!options.repo) {

0 commit comments

Comments
 (0)