Order of URI handlers

vinci1989
Posts: 28
Joined: Mon Oct 08, 2018 6:07 pm

Order of URI handlers

Postby vinci1989 » Sat Dec 10, 2022 1:32 pm

Currently (v5.0 branch) the order in which URI handlers are processed depends on the order they are registered. This can be useful when mixing wildcard handlers with specific ones.

e.g.

Code: Select all

.uri = "/hello"
.uri = "/*"
Since this behavior isn't documented anywhere I wonder though... is it always going to stay like this or would one be depending on an "implementation detail"?

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Order of URI handlers

Postby mbratch » Sun Dec 11, 2022 3:32 am

I use the URI handlers and thought this was the normal behavior even in ver 4.4. I am not a developer on the ESP-IDF team, but it seems quite logical to handle URIs in the order they are registered. This is needed so that you can register your more specific paths first followed by the more general.

Who is online

Users browsing this forum: Apostal2008, Google [Bot], jgrossholtz, kapucin22, MicroController, niels.1234 and 126 guests