Skip to content

Commit

Permalink
Set Access-Control-Max-Age to 1 day
Browse files Browse the repository at this point in the history
  • Loading branch information
harryttd committed Oct 13, 2023
1 parent f062f2c commit 6c881eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const cors = (_: Request, res: Response, next: NextFunction) => {
res
.setHeader("Access-Control-Allow-Origin", host)
.setHeader("Access-Control-Allow-Methods", "GET, POST")
// Clients should cache CORS policy for 1 day
.setHeader("Access-Control-Max-Age", 86400)
.setHeader(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
Expand Down

0 comments on commit 6c881eb

Please sign in to comment.