Skip to content

Commit

Permalink
Removing an assignment because it'd be inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 16, 2018
1 parent 9a30d4b commit c4cc833
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,9 @@ function stream (req, res) {
}

function statik (req, res) {
const pathname = path.resolve(path.join(req.server.config.root, req.parsed.pathname.replace(regex.root, ""))),
invalid = pathname.indexOf(req.server.config.root) !== 0;
const pathname = path.resolve(path.join(req.server.config.root, req.parsed.pathname.replace(regex.root, "")));

if (invalid === true) {
if (pathname.indexOf(req.server.config.root) !== 0) {
res.error(404);
} else {
file(req, res, err2 => {
Expand Down

0 comments on commit c4cc833

Please sign in to comment.