Fast follows on 0.34 (#9034)

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Charles Bochet
2024-12-12 16:46:48 +01:00
committed by GitHub
parent 05cd0d1803
commit 77c2961912
27 changed files with 141 additions and 76 deletions

View File

@ -11,7 +11,7 @@ import { Response } from 'express';
// the CORS headers are missing in the response.
// This class add CORS headers to exception response to avoid misleading CORS error
@Catch()
export class ApplyCorsToExceptions implements ExceptionFilter {
export class UnhandledExceptionFilter implements ExceptionFilter {
catch(exception: any, host: ArgumentsHost) {
const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>();
@ -20,6 +20,7 @@ export class ApplyCorsToExceptions implements ExceptionFilter {
return;
}
// TODO: Check if needed, remove otherwise.
response.header('Access-Control-Allow-Origin', '*');
response.header(
'Access-Control-Allow-Methods',