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>
pull/1043/head
parent
ecfc7ea68e
commit
bb7d26d19f
|
@ -1,5 +1,5 @@
|
||||||
import { BROWSERS } from './constants';
|
import { BROWSERS } from './constants';
|
||||||
import { removeTrailingSlash, removeWWW } from './url';
|
import { removeTrailingSlash, removeWWW, getDomainName } from './url';
|
||||||
|
|
||||||
export const urlFilter = (data, { raw }) => {
|
export const urlFilter = (data, { raw }) => {
|
||||||
const isValidUrl = url => {
|
const isValidUrl = url => {
|
||||||
|
@ -46,7 +46,8 @@ export const urlFilter = (data, { raw }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const refFilter = (data, { domain, domainOnly, 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 links = {};
|
||||||
|
|
||||||
const isValidRef = referrer => {
|
const isValidRef = referrer => {
|
||||||
|
|
Loading…
Reference in New Issue