Skip to content

Commit

Permalink
fix(sirv): only use req.path if has _decoded flag;
Browse files Browse the repository at this point in the history
- Related: sveltejs/kit#2191
- Related: lukeed/polka#172
  • Loading branch information
lukeed committed Aug 13, 2021
1 parent 99ee9c7 commit a7bd672
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function (dir, opts={}) {
if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
extns.push(...extensions); // [...br, ...gz, orig, ...exts]

let pathname = req.path || parse(req, true).pathname;
let pathname = !!req._decoded && req.path || parse(req, true).pathname;
let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns);
if (!data) return next ? next() : isNotFound(req, res);

Expand Down

0 comments on commit a7bd672

Please sign in to comment.