breaking: Move font download to use follow-redirects
deprecates http font downloads
This commit is contained in:
parent
456b5d58e3
commit
1889639200
|
|
@ -5,7 +5,7 @@ import {
|
||||||
mkdirSync,
|
mkdirSync,
|
||||||
symlink,
|
symlink,
|
||||||
} from "node:fs";
|
} from "node:fs";
|
||||||
import { IncomingMessage } from "node:http";
|
import { https } from "follow-redirects";
|
||||||
import LambdaFS from "./lambdafs";
|
import LambdaFS from "./lambdafs";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { URL } from "node:url";
|
import { URL } from "node:url";
|
||||||
|
|
@ -108,10 +108,7 @@ class Chromium {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let handler =
|
https.get(input, (response) => {
|
||||||
url.protocol === "http:" ? require("http").get : require("https").get;
|
|
||||||
|
|
||||||
handler(input, (response: IncomingMessage) => {
|
|
||||||
if (response.statusCode !== 200) {
|
if (response.statusCode !== 200) {
|
||||||
return reject(`Unexpected status code: ${response.statusCode}.`);
|
return reject(`Unexpected status code: ${response.statusCode}.`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue