Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Aug 6, 2021
1 parent 9c77d30 commit 2bf3ccd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class AlibabaCloudEcsDetector implements Detector {
const req = http.request(options, res => {
clearTimeout(timeoutId);
const { statusCode } = res;
if (statusCode && statusCode >= 200 && statusCode < 300) {
if (typeof statusCode !== 'number' || !(statusCode >= 200 && statusCode < 300)) {
res.destroy();
return reject(
new Error('Failed to load page, status code: ' + statusCode)
);
Expand Down

0 comments on commit 2bf3ccd

Please sign in to comment.