Skip to content

infinit redirect with parameter #12

Description

@xileftenurb

Hi,
I found a bug,
I have this route that cause problem with the slash package

router.get('/restaurant-:resto', function (req, res, next) {
    const restoMain = req.data.resto.find(r => r.permalink === req.params.resto);
    if (restoMain) {
        res.render('fr/pages/contact-fiche', Object.assign({ apiKey: settings.apiKey, restoMain: restoMain,
            hreflang : "/en/restaurant-" + req.params.resto
        }, paramsBase, req.data));
    } else {
        next();
    }
});

If the resto is find, all good. but if not, it call "next()", and it go in a infinite redirect loop between "/restaurant-test" and "/restaurant-test/"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions