From 188963920035701484abab6475e86c30ccf832db Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Fri, 24 Mar 2023 15:43:50 -0400 Subject: [PATCH] breaking: Move font download to use follow-redirects deprecates http font downloads --- source/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/index.ts b/source/index.ts index 4bcf2d3..fdf4224 100644 --- a/source/index.ts +++ b/source/index.ts @@ -5,7 +5,7 @@ import { mkdirSync, symlink, } from "node:fs"; -import { IncomingMessage } from "node:http"; +import { https } from "follow-redirects"; import LambdaFS from "./lambdafs"; import { join } from "node:path"; import { URL } from "node:url"; @@ -108,10 +108,7 @@ class Chromium { }); }); } else { - let handler = - url.protocol === "http:" ? require("http").get : require("https").get; - - handler(input, (response: IncomingMessage) => { + https.get(input, (response) => { if (response.statusCode !== 200) { return reject(`Unexpected status code: ${response.statusCode}.`); }