0

I’m chasing an odd pattern matching issue in labstack/echo and would like your thoughts.

Would the route

/first/:parameter/second

match the url http://hostname/first or http://hostname/first/ ?

What about /first/:parameter1/second/:parameter2/:parameter3/third/ ?

To my eye, they should not match the simple urls, but they appear to be. Is that desired behavior? Has anyone followed a parameter with a static in the url pattern?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • No idea about echo, but for this cases dynamic/static I use https://violetear.org/, in where you could match a mix of both – nbari Aug 09 '17 at 11:49

1 Answers1

-1

In Echo your routes need to be in an order to not match. See the Routing Guide here and look for Path Matching Order

https://echo.labstack.com/guide/routing

Switch around your routes so your /first/:parameter/second doesn't match /first/:parameter1/second/:parameter2/:parameter3/third/

Trevor V
  • 1,958
  • 13
  • 33
  • do you mean the order of route declaration matters ? That doesn't seem to be the case, indicated by " Routes can be written in any order." stated on the referenced URL – hbogert Sep 04 '20 at 13:49