From ff43e6891c0215fe7e6a4fa744ef6f43c4e17601 Mon Sep 17 00:00:00 2001 From: patrikpessi Date: Wed, 9 Feb 2022 16:05:06 +0200 Subject: [PATCH 1/2] Support '.' in paths eg 'docs/1.2.3/en' --- packages/sirv/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sirv/index.js b/packages/sirv/index.js index fe01068..0088dc3 100644 --- a/packages/sirv/index.js +++ b/packages/sirv/index.js @@ -133,7 +133,7 @@ export default function (dir, opts={}) { let ignores = []; if (opts.ignores !== false) { - ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/); // any extn + ignores.push(/[/]([A-Za-z\s\d~$._-]+\.[\w]+)[^.\d(?=\/\n)]{1,}$/); // any extn if (opts.dotfiles) ignores.push(/\/\.\w/); else ignores.push(/\/\.well-known/); [].concat(opts.ignores || []).forEach(x => { From dc17146800c0621b122ba13b2bf92f49ffde2eab Mon Sep 17 00:00:00 2001 From: patrikpessi Date: Tue, 22 Feb 2022 13:45:54 +0200 Subject: [PATCH 2/2] Updated file name/extension regex --- packages/sirv/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sirv/index.js b/packages/sirv/index.js index 0088dc3..c936b46 100644 --- a/packages/sirv/index.js +++ b/packages/sirv/index.js @@ -133,7 +133,7 @@ export default function (dir, opts={}) { let ignores = []; if (opts.ignores !== false) { - ignores.push(/[/]([A-Za-z\s\d~$._-]+\.[\w]+)[^.\d(?=\/\n)]{1,}$/); // any extn + ignores.push(/[/]([\w\.$~-]{0,}\.[\w\.$~-]+)[^(\.\/)]$/); // any extn if (opts.dotfiles) ignores.push(/\/\.\w/); else ignores.push(/\/\.well-known/); [].concat(opts.ignores || []).forEach(x => {