mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01: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
@ -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