Skip to content

Commit

Permalink
Allow caching CORS preflights (#20)
Browse files Browse the repository at this point in the history
Without this a browser will hit the network much more than it needs to.
Firefox seems to be worse than Chrome, interestingly; I think it's being
a bit more careful about CORS.
  • Loading branch information
amrc-benmorrow authored Apr 4, 2024
2 parents 4900996 + c8517f4 commit d09daed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class WebAPI {
let app = this.app;

/* CORS */
app.use(cors({ credentials: true }));
app.use(cors({ credentials: true, maxAge: 86400 }));

/* Body decoders. These will only decode request bodies of the
* appropriate content-type. */
Expand Down

0 comments on commit d09daed

Please sign in to comment.