-
-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Open
pillarjs/router
#190Labels
Description
Router instance mounted explicitly at '//' exposes routes when path begins only with a single /:
const TestRoutes = express.Router();
TestRoutes.get('/drop/table/:table', (req, res) => {
// drop table
res.send(`Dropped table '${req.params.table}'`);
})
TestRoutes.get('/', sendListOfTestRoutes);
if (TEST) app.use('//', TestRoutes);
app.listen();Expected behavior is that navigating to http://hostname/ would bypass this Router and go to the main app, but instead Express serves the list of test routes mounted within the router at //.
Reactions are currently unavailable