mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-25 02:36:20 +01:00
Add maxAge config to cache CORS preflight request
This commit is contained in:
parent
1d9c3133f0
commit
86aaa5519e
@ -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 New Issue
Block a user