From 518bf93f6f2af8e608c2871c5453a4ca4ecae702 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 3 Dec 2019 02:06:44 +0200 Subject: [PATCH] Fix incompatibility with Node.js 10 versions prior to 10.9.0 --- CHANGELOG.md | 2 +- src/data/updates.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8cbdf..7ad867c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ * New rewritten instructions for setting up and using the bot * New easy-to-use `start.bat` file for Windows * Update several package dependencies -* Fixed incompatibility with certain Node.js 10 versions +* Fixed incompatibility with Node.js 10 versions prior to 10.9.0 ## v2.28.0 * Fix error when saving attachments locally with `attachmentStorage` set to `"local"` (default) when the bot's folder is diff --git a/src/data/updates.js b/src/data/updates.js index 36d4239..d5a574e 100644 --- a/src/data/updates.js +++ b/src/data/updates.js @@ -39,12 +39,12 @@ async function refreshVersions() { const [, owner, repo] = parsedUrl.pathname.split('/'); if (! owner || ! repo) return; - const apiUrl = `https://api.github.com/repos/${owner}/${repo}/tags`; https.get( - apiUrl, { + hostname: 'api.github.com', + path: `/repos/${owner}/${repo}/tags`, headers: { - 'User-Agent': `Modmailbot (https://github.com/${owner}/${repo}) (${packageJson.version})` + 'User-Agent': `Modmail Bot (https://github.com/${owner}/${repo}) (${packageJson.version})` } }, async res => {