mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 19:15:37 +01:00
fix(api): reject all metrics requests for invalid domains
Add check for requested metric type before domain name check. Only the referrer metrics use the domain name; all other metrics should be unaffected. This partly closes #503
This commit is contained in:
parent
7eb0ca8034
commit
a48cedb3f3
1 changed files with 1 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ export default async (req, res) => {
|
|||
|
||||
const { id, type, start_at, end_at, domain, url } = req.query;
|
||||
|
||||
if (domain && !DOMAIN_REGEX.test(domain)) {
|
||||
if (type === 'referrer' && domain && !DOMAIN_REGEX.test(domain)) {
|
||||
return badRequest(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue