Change file buffer read handling

This commit is contained in:
Cohee 2023-08-30 20:55:00 +03:00 committed by GitHub
parent f46f2f6901
commit 938e244987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -4286,8 +4286,8 @@ app.post('/viewsecrets', jsonParser, async (_, response) => {
}
try {
const fileContents = fs.readFileSync(SECRETS_FILE);
const secrets = JSON.parse(fileContents.toString());
const fileContents = fs.readFileSync(SECRETS_FILE, 'utf8');
const secrets = JSON.parse(fileContents);
return response.send(secrets);
} catch (error) {
console.error(error);