We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c17b724 commit 9c68060Copy full SHA for 9c68060
src/index.ts
@@ -45,18 +45,18 @@ export async function getCertificate(
45
const cachePath = path.join(cacheDir, '_cert.pem')
46
47
try {
48
- const content = await fsp.readFile(cachePath, "utf8")
+ const content = await fsp.readFile(cachePath, 'utf8')
49
const certContent = content.match(
50
/-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----/,
51
)
52
if (!certContent) {
53
- throw new Error("certificate not detected.")
+ throw new Error('certificate not detected.')
54
}
55
56
const cert = forge.pki.certificateFromPem(certContent[0])
57
58
if (new Date() > cert.validity.notAfter) {
59
- throw new Error("cache is outdated.")
+ throw new Error('cache is outdated.')
60
61
62
return content
0 commit comments