mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 23:33:37 +01:00
Merge pull request #288 from vitobotta/master
Fix CORS error when IGNORE_IP is set
This commit is contained in:
commit
6539fd4016
@ -6,6 +6,8 @@ import { createToken } from 'lib/crypto';
|
|||||||
import { getIpAddress } from '../../lib/request';
|
import { getIpAddress } from '../../lib/request';
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
|
await useCors(req, res);
|
||||||
|
|
||||||
if (isBot(req.headers['user-agent'])) {
|
if (isBot(req.headers['user-agent'])) {
|
||||||
return ok(res);
|
return ok(res);
|
||||||
}
|
}
|
||||||
@ -19,7 +21,6 @@ export default async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await useCors(req, res);
|
|
||||||
await useSession(req, res);
|
await useSession(req, res);
|
||||||
|
|
||||||
const { type, payload } = req.body;
|
const { type, payload } = req.body;
|
||||||
|
Loading…
Reference in New Issue
Block a user