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 d6ada17 commit 4ca3d0eCopy full SHA for 4ca3d0e
1 file changed
src/util.ts
@@ -18,10 +18,14 @@ export const resolveHttpsConfig = (
18
}
19
20
const certPath = path.join(__dirname, 'fake-cert.pem');
21
+
22
if (fs.existsSync(certPath)) {
23
const stats = fs.statSync(certPath);
24
+ const timeDiff = Date.now() - stats.mtimeMs;
25
+ const daysDiff = timeDiff / (1000 * 60 * 60 * 24);
26
27
// Default validity period is 30 days
- if (stats.mtimeMs <= Date.now() - 1000 * 60 * 60 * 24 * 30) {
28
+ if (daysDiff < 30) {
29
const content = fs.readFileSync(certPath, { encoding: 'utf-8' });
30
return {
31
key: content,
0 commit comments