We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee50560 commit a4e9737Copy full SHA for a4e9737
1 file changed
src/receiptio-server/src/services/cache.service.ts
@@ -57,7 +57,7 @@ export class CacheService {
57
const fullPath = join(this.cfg.staticCacheDir, filePath);
58
const data = readFileSync(fullPath, 'utf-8');
59
utimesSync(fullPath, new Date(), new Date());
60
- return JSON.parse(data) as T;
+ return Buffer.from(data, 'base64') as T;
61
} catch (error) {
62
this.logger.error(
63
`Failed to read from file ${filePath}: ${error.message}`,
@@ -70,7 +70,7 @@ export class CacheService {
70
try {
71
writeFileSync(
72
join(this.cfg.staticCacheDir, filePath),
73
- JSON.stringify(value),
+ Buffer.from(value as Buffer).toString('base64'),
74
'utf-8',
75
);
76
0 commit comments