Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit 2d38980

Browse files
committed
fix(core): use toObject to hide owner field
1 parent e9b56d0 commit 2d38980

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/modules/files/files.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class FilesController {
2525
const file = await this.filesService.findOne(id);
2626
await file.visibility?.init();
2727

28-
if (await this.filesService.canReadFile(file, req.user as User)) return file;
28+
if (await this.filesService.canReadFile(file, req.user as User)) return file.toObject();
2929
throw new UnauthorizedException(this.t.Errors.File.Unauthorized(file.visibility?.name));
3030
}
3131
}

tests/e2e/files.e2e-spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ describe('Files (e2e)', () => {
120120
id: file.id,
121121
filename: 'test.png',
122122
mimetype: 'image/png',
123-
path: 'test.png',
124123
size: 123,
125124
visibility: file.visibility.id,
126125
description: 'foo bar',

0 commit comments

Comments
 (0)