1

The route I'm trying to make looks something similar to this:

/config/param1:param2:param3/

Considering param1|2|3 are all route params the route definition should look like

/config/:param1::param2::param3/

which works good until the request is URI encoded, i.e.

/config/param1%3Aparam2%3Aparam3/

I know I could define the route twice, like

router.get([
    '/config/:param1::param2::param3',
    '/config/:param1%3A:param2%3A:param3'
], ...);

but I would really like to avoid this kind of definition. I've tried to use encodeURIComponent, character escaping and RegExp, but none allowed to use both ways at a time.

Is there a better way than defining the same route twice?

lolbas
  • 794
  • 1
  • 9
  • 34

0 Answers0