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

Fix route not found when url is /? #105

Merged
merged 1 commit into from
Feb 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}