mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 23:37:15 +08:00
chore(server): allow preflight workspace blob url (#11783)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Controller, Get, Logger, Param, Res } from '@nestjs/common';
|
import { Controller, Get, Logger, Param, Query, Res } from '@nestjs/common';
|
||||||
import type { Response } from 'express';
|
import type { Response } from 'express';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -37,6 +37,7 @@ export class WorkspacesController {
|
|||||||
@CurrentUser() user: CurrentUser | undefined,
|
@CurrentUser() user: CurrentUser | undefined,
|
||||||
@Param('id') workspaceId: string,
|
@Param('id') workspaceId: string,
|
||||||
@Param('name') name: string,
|
@Param('name') name: string,
|
||||||
|
@Query('redirect') redirect: string | undefined,
|
||||||
@Res() res: Response
|
@Res() res: Response
|
||||||
) {
|
) {
|
||||||
await this.ac
|
await this.ac
|
||||||
@@ -51,7 +52,13 @@ export class WorkspacesController {
|
|||||||
|
|
||||||
if (redirectUrl) {
|
if (redirectUrl) {
|
||||||
// redirect to signed url
|
// redirect to signed url
|
||||||
return res.redirect(redirectUrl);
|
if (redirect === 'manual') {
|
||||||
|
return res.send({
|
||||||
|
url: redirectUrl,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return res.redirect(redirectUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!body) {
|
if (!body) {
|
||||||
|
|||||||
Reference in New Issue
Block a user