11diff --git a/build.js b/build.js
2- index 3734120d67745ff83b2df07fa5d0a40dcb92a69b..7bfb6faa81ccfcb9016fd2b071a2f93b24e75479 100644
2+ index 3734120d67745ff83b2df07fa5d0a40dcb92a69b..bd57f693ac2bd4555a12e7a5436fb9524789ef66 100644
33--- a/build.js
44+++ b/build.js
55@@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) {
@@ -19,6 +19,15 @@ index 3734120d67745ff83b2df07fa5d0a40dcb92a69b..7bfb6faa81ccfcb9016fd2b071a2f93b
1919 headers = toHeaders(name, stats, isEtag);
2020 headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
2121 return { abs, stats, headers };
22+ @@ -164,7 +165,7 @@ module.exports = function (dir, opts={}) {
23+ });
24+ }
25+
26+ - let lookup = opts.dev ? viaLocal.bind(0, dir + sep, isEtag) : viaCache.bind(0, FILES);
27+ + let lookup = opts.dev ? viaLocal.bind(0, dir.endsWith(sep) ? dir : dir + sep, isEtag) : viaCache.bind(0, FILES);
28+
29+ return function (req, res, next) {
30+ let extns = [''];
2231@@ -179,7 +180,7 @@ module.exports = function (dir, opts={}) {
2332 catch (err) { /* malform uri */ }
2433 }
@@ -29,7 +38,7 @@ index 3734120d67745ff83b2df07fa5d0a40dcb92a69b..7bfb6faa81ccfcb9016fd2b071a2f93b
2938
3039 if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
3140diff --git a/build.mjs b/build.mjs
32- index 2f866d5216c951ec125f2044af070fa6b530e375..a4dfae6d0738568b4f9b86fdfbec47c94562957c 100644
41+ index 2f866d5216c951ec125f2044af070fa6b530e375..d5335bfbb16e23b57385c1a83226611e29c39093 100644
3342--- a/build.mjs
3443+++ b/build.mjs
3544@@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) {
@@ -49,6 +58,15 @@ index 2f866d5216c951ec125f2044af070fa6b530e375..a4dfae6d0738568b4f9b86fdfbec47c9
4958 headers = toHeaders(name, stats, isEtag);
5059 headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
5160 return { abs, stats, headers };
61+ @@ -164,7 +165,7 @@ export default function (dir, opts={}) {
62+ });
63+ }
64+
65+ - let lookup = opts.dev ? viaLocal.bind(0, dir + sep, isEtag) : viaCache.bind(0, FILES);
66+ + let lookup = opts.dev ? viaLocal.bind(0, dir.endsWith(sep) ? dir : dir + sep, isEtag) : viaCache.bind(0, FILES);
67+
68+ return function (req, res, next) {
69+ let extns = [''];
5270@@ -179,7 +180,7 @@ export default function (dir, opts={}) {
5371 catch (err) { /* malform uri */ }
5472 }
0 commit comments