Skip to content

Commit 22dd5e1

Browse files
committed
Refactor HTTPS configuration to use boolean value for enabled flag
1 parent 8001961 commit 22dd5e1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default (): ConfigInstance => ({
8686
limit: '500mb',
8787
},
8888
https: {
89-
enabled: !!parseInt(process.env['SESAME_HTTPS_ENABLED']) || false,
89+
enabled: /yes|1|on|true/i.test(process.env['SESAME_HTTPS_ENABLED']),
9090
key: process.env['SESAME_HTTPS_PATH_KEY'] || '',
9191
cert: process.env['SESAME_HTTPS_PATH_CERT'] || '',
9292
},

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ declare const module: any;
2626
key: readFileSync(cfg.application?.https?.key),
2727
cert: readFileSync(cfg.application?.https?.cert),
2828
};
29+
logger.log('HTTPS is enabled !');
2930
} catch (error) {
3031
logger.error('Error while reading https key and cert', error);
3132
}

0 commit comments

Comments
 (0)