mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
Merge pull request #1752 from sdvcrx/add-cors-cache
Add maxAge config to cache CORS preflight request
This commit is contained in:
commit
4b1013c8c6
1 changed files with 4 additions and 1 deletions
|
|
@ -11,7 +11,10 @@ import { getUser } from '../queries';
|
|||
|
||||
const log = debug('umami:middleware');
|
||||
|
||||
export const useCors = createMiddleware(cors());
|
||||
export const useCors = createMiddleware(cors({
|
||||
// Cache CORS preflight request 24 hours by default
|
||||
maxAge: process.env.CORS_MAX_AGE || 86400,
|
||||
}));
|
||||
|
||||
export const useSession = createMiddleware(async (req, res, next) => {
|
||||
const session = await findSession(req);
|
||||
|
|
|
|||
Loading…
Reference in a new issue