Skip to content

Commit

Permalink
chore(sirv): bump “@polka/url” for better decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jun 23, 2019
1 parent ea8a646 commit 1757b26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = function (dir, opts={}) {

if (opts.dev) {
return function (req, res, next) {
let stats, file, uri=decodeURIComponent(req.path || req.pathname || parser(req).pathname);
let stats, file, uri = req.path || parser(req, true).pathname;
let arr = [uri].concat(toAssume(uri, extensions)).map(x => join(dir, x)).filter(fs.existsSync);
while (file = arr.shift()) {
stats = fs.statSync(file);
Expand Down Expand Up @@ -115,7 +115,7 @@ module.exports = function (dir, opts={}) {
});

return function (req, res, next) {
let pathname = decodeURIComponent(req.path || req.pathname || parser(req).pathname);
let pathname = req.path || parser(req, true).pathname;
let data = FILES[pathname] || find(pathname, extensions);
if (!data) return next ? next() : isNotFound(req, res);

Expand Down
2 changes: 1 addition & 1 deletion packages/sirv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"node": ">= 6"
},
"dependencies": {
"@polka/url": "^0.5.0",
"@polka/url": "^1.0.0-next.3",
"mime": "^2.3.1"
}
}

0 comments on commit 1757b26

Please sign in to comment.