mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 08:06:24 +08:00
feat(server): s3 presigned url (#11364)
This commit is contained in:
@@ -602,7 +602,17 @@ export class CopilotController implements BeforeApplicationShutdown {
|
||||
@Param('workspaceId') workspaceId: string,
|
||||
@Param('key') key: string
|
||||
) {
|
||||
const { body, metadata } = await this.storage.get(userId, workspaceId, key);
|
||||
const { body, metadata, redirectUrl } = await this.storage.get(
|
||||
userId,
|
||||
workspaceId,
|
||||
key,
|
||||
true
|
||||
);
|
||||
|
||||
if (redirectUrl) {
|
||||
// redirect to signed url
|
||||
return res.redirect(redirectUrl);
|
||||
}
|
||||
|
||||
if (!body) {
|
||||
throw new BlobNotFound({
|
||||
|
||||
Reference in New Issue
Block a user