Use an undefined check rather than hasOwnProperty.

This commit is contained in:
Chris Gavin
2020-11-02 08:47:11 +00:00
parent 1220ae5bfd
commit 1f7bae7ab8
3 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ exports.getApiClient = function (githubAuth, githubUrl, mode, allowLocalRun = fa
const customOctokit = githubUtils.GitHub.plugin(retry.retry, (octokit, _) => {
octokit.hook.after("request", (response, _) => {
if (!hasBeenWarnedAboutVersion &&
Object.prototype.hasOwnProperty.call(response.headers, GITHUB_ENTERPRISE_VERSION_HEADER)) {
response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] !== undefined) {
const installedVersion = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER];
const disallowedAPIVersionReason = apiVersionInRange(installedVersion, apiCompatibility.minimumVersion, apiCompatibility.maximumVersion);
const logger = mode === "actions"