From 97d48a084fbfa451e3a7938126e5a17b57c3c36e Mon Sep 17 00:00:00 2001 From: Changyu Geng Date: Tue, 24 Aug 2021 16:18:08 +0800 Subject: [PATCH] Use https for puzzle download Fix the `Error: statusCode: 301 while downloading puzzle xxx` bug --- puzzles/nonograms.org/downloader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puzzles/nonograms.org/downloader.js b/puzzles/nonograms.org/downloader.js index deeaea7..c02d2ff 100644 --- a/puzzles/nonograms.org/downloader.js +++ b/puzzles/nonograms.org/downloader.js @@ -1,5 +1,5 @@ const fs = require("fs"); -const http = require('http'); +const https = require('https'); const path = require("path"); const vm = require('vm'); @@ -36,7 +36,7 @@ module.exports = (id, callback) => { }); }; - http.get(`http://www.nonograms.org/nonograms/i/${id}`, (response) => { + https.get(`https://www.nonograms.org/nonograms/i/${id}`, (response) => { let data = ''; response.on('data', chunk => { data += chunk;