mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fix referrer filter
7530de87d2
introduced a regression: the
domain parameter in refFilter() contains 'https://', which bypass the
new regex; thus we readd the call to getDomainName().
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
ecfc7ea68e
commit
bb7d26d19f
@ -1,5 +1,5 @@
|
||||
import { BROWSERS } from './constants';
|
||||
import { removeTrailingSlash, removeWWW } from './url';
|
||||
import { removeTrailingSlash, removeWWW, getDomainName } from './url';
|
||||
|
||||
export const urlFilter = (data, { raw }) => {
|
||||
const isValidUrl = url => {
|
||||
@ -46,7 +46,8 @@ export const urlFilter = (data, { raw }) => {
|
||||
};
|
||||
|
||||
export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
const regex = new RegExp(`http[s]?://([a-z0-9-]+\\.)*${domain}`);
|
||||
const domainName = getDomainName(domain);
|
||||
const regex = new RegExp(`http[s]?://([a-z0-9-]+\\.)*${domainName}`);
|
||||
const links = {};
|
||||
|
||||
const isValidRef = referrer => {
|
||||
|
Loading…
Reference in New Issue
Block a user