Skip to content

Commit

Permalink
updated header options
Browse files Browse the repository at this point in the history
  • Loading branch information
jazicorn committed Oct 5, 2023
1 parent f251757 commit b0c05c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ class App {
this.app.use(cors({
origin: this.corsOptions
}));
this.app.use( (req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
next();
});
this.app.options("/", (req, res) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS");
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
res.sendStatus(204);
});
this.app.use( (req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
next();
});
// this.app.set('trust proxy', 1) // trust first proxy
// this.app.use(session({
// secret: process.env.SECRET_TOKEN,
Expand Down

0 comments on commit b0c05c5

Please sign in to comment.