Skip to content

Commit a4e9737

Browse files
committed
fix: store cache as base64
1 parent ee50560 commit a4e9737

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/receiptio-server/src/services/cache.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class CacheService {
5757
const fullPath = join(this.cfg.staticCacheDir, filePath);
5858
const data = readFileSync(fullPath, 'utf-8');
5959
utimesSync(fullPath, new Date(), new Date());
60-
return JSON.parse(data) as T;
60+
return Buffer.from(data, 'base64') as T;
6161
} catch (error) {
6262
this.logger.error(
6363
`Failed to read from file ${filePath}: ${error.message}`,
@@ -70,7 +70,7 @@ export class CacheService {
7070
try {
7171
writeFileSync(
7272
join(this.cfg.staticCacheDir, filePath),
73-
JSON.stringify(value),
73+
Buffer.from(value as Buffer).toString('base64'),
7474
'utf-8',
7575
);
7676
} catch (error) {

0 commit comments

Comments
 (0)