chore(server): allow preflight workspace blob url (#11783)

This commit is contained in:
forehalo
2025-04-18 01:23:14 +00:00
parent a9e4690d2d
commit 5e0d1fae98

View File

@@ -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 {
@@ -37,6 +37,7 @@ export class WorkspacesController {
@CurrentUser() user: CurrentUser | undefined,
@Param('id') workspaceId: string,
@Param('name') name: string,
@Query('redirect') redirect: string | undefined,
@Res() res: Response
) {
await this.ac
@@ -51,8 +52,14 @@ export class WorkspacesController {
if (redirectUrl) {
// redirect to signed url
if (redirect === 'manual') {
return res.send({
url: redirectUrl,
});
} else {
return res.redirect(redirectUrl);
}
}
if (!body) {
throw new BlobNotFound({