mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Allow multiple tracker names.
This commit is contained in:
parent
f0d13efc7a
commit
dbc19e4ffd
2 changed files with 11 additions and 6 deletions
|
|
@ -24,8 +24,9 @@ function customScriptName(req) {
|
|||
if (scriptName) {
|
||||
const url = req.nextUrl.clone();
|
||||
const { pathname } = url;
|
||||
const names = scriptName.split(',').map(name => name.trim());
|
||||
|
||||
if (pathname.endsWith(scriptName)) {
|
||||
if (names.find(name => pathname.endsWith(name))) {
|
||||
url.pathname = '/script.js';
|
||||
return NextResponse.rewrite(url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue