Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #105 from thgh/patch-2
Browse files Browse the repository at this point in the history
Fix route not found when url is /?
  • Loading branch information
Rich-Harris authored Feb 3, 2018
2 parents b20c1c0 + 422e31e commit 16cb1fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function connect_prod() {
export default dev ? connect_dev : connect_prod;

function set_req_pathname(req, res, next) {
req.pathname = req.url.replace(/\?.+/, '');
req.pathname = req.url.replace(/\?.*/, '');
next();
}

Expand Down Expand Up @@ -279,4 +279,4 @@ function try_serialize(data) {
} catch (err) {
return null;
}
}
}

0 comments on commit 16cb1fc

Please sign in to comment.