HotFix Allow Origin header for CORS (#1566)
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
parent
f6b8677c2e
commit
75ba9ddae8
2 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import { HttpResponse } from "uWebSockets.js";
|
||||
import { FRONT_URL } from "../Enum/EnvironmentVariable";
|
||||
|
||||
export class BaseController {
|
||||
protected addCorsHeaders(res: HttpResponse): void {
|
||||
|
@ -12,6 +13,7 @@ export class BaseController {
|
|||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
protected errorToResponse(e: any, res: HttpResponse): void {
|
||||
res.writeHeader("Access-Control-Allow-Origin", FRONT_URL);
|
||||
if (e && e.message) {
|
||||
let url = e?.config?.url;
|
||||
if (url !== undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue