mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Fix www replace.
This commit is contained in:
parent
52bbc3692d
commit
13cf286874
@ -7,7 +7,7 @@ export const urlFilter = data => {
|
|||||||
try {
|
try {
|
||||||
const { pathname, search } = new URL(url, location.origin);
|
const { pathname, search } = new URL(url, location.origin);
|
||||||
|
|
||||||
if (search.startsWith('?/')) {
|
if (search.startsWith('?')) {
|
||||||
return `${pathname}${search}`;
|
return `${pathname}${search}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ export const refFilter = data => {
|
|||||||
try {
|
try {
|
||||||
const url = new URL(x);
|
const url = new URL(x);
|
||||||
|
|
||||||
id = url.hostname.replace('www', '') || url.href;
|
id = url.hostname.replace(/www\./, '') || url.href;
|
||||||
} catch {
|
} catch {
|
||||||
id = '';
|
id = '';
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ok } from 'next-basics';
|
import { ok } from 'next-basics';
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
return ok(res, 'nice');
|
return ok(res);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user