From a6c4a26a01f0f5f1795140d527f5b8c1eecd22d3 Mon Sep 17 00:00:00 2001 From: bobmacks Date: Mon, 17 Apr 2023 18:01:29 +1000 Subject: [PATCH] Replace query parameters with header auth Query parameter authentication has since been deprecated in 2020 in-lieu of header authentication as per https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/. --- backup.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backup.js b/backup.js index 988289e..c2a9db2 100644 --- a/backup.js +++ b/backup.js @@ -73,12 +73,14 @@ module.exports = function(options) { const arhiveURL = "https://api.github.com/repos/" + repo.full_name + - "/tarball/master?access_token=" + - options.githubAccessToken + "/tarball/master?access_token=" const requestOptions = { url: arhiveURL, headers: { - "User-Agent": "nodejs" + "User-Agent": "nodejs", + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + "Authorization": "Bearer " + options.githubAccessToken } }