Merge pull request #105 from thgh/patch-2

Fix route not found when url is /?
This commit is contained in:
Rich Harris
2018-02-03 12:03:36 -05:00
committed by GitHub

View File

@@ -125,7 +125,7 @@ function connect_prod() {
export default dev ? connect_dev : connect_prod; export default dev ? connect_dev : connect_prod;
function set_req_pathname(req, res, next) { function set_req_pathname(req, res, next) {
req.pathname = req.url.replace(/\?.+/, ''); req.pathname = req.url.replace(/\?.*/, '');
next(); next();
} }
@@ -279,4 +279,4 @@ function try_serialize(data) {
} catch (err) { } catch (err) {
return null; return null;
} }
} }