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

Commit 16cb1fc

Browse files
authored
Merge pull request #105 from thgh/patch-2
Fix route not found when url is /?
2 parents b20c1c0 + 422e31e commit 16cb1fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/middleware/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function connect_prod() {
125125
export default dev ? connect_dev : connect_prod;
126126

127127
function set_req_pathname(req, res, next) {
128-
req.pathname = req.url.replace(/\?.+/, '');
128+
req.pathname = req.url.replace(/\?.*/, '');
129129
next();
130130
}
131131

@@ -279,4 +279,4 @@ function try_serialize(data) {
279279
} catch (err) {
280280
return null;
281281
}
282-
}
282+
}

0 commit comments

Comments
 (0)