Merge pull request #1127 from Zxilly/master

fix: cover edge case of script name
This commit is contained in:
Mike Cao 2022-04-27 08:33:52 -07:00 committed by GitHub
commit 08dff1293e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ function customScriptName(req) {
if (scriptName) {
const url = req.nextUrl.clone();
const { pathname } = url;
const names = scriptName.split(',').map(name => (name + '.js').trim());
const names = scriptName.split(',').map(name => name.trim() + '.js');
if (names.find(name => pathname.endsWith(name))) {
url.pathname = '/umami.js';