httpd_register_uri_handler, catch all un-registered requests

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

httpd_register_uri_handler, catch all un-registered requests

Postby mikemoy » Tue Feb 12, 2019 2:40 pm

In messing with esp_http_server.h, we must register each incoming request with httpd_register_uri_handler().
Is there a way to see if there was any other request coming in that was not registered ?

ESP_Anurag
Posts: 19
Joined: Fri Aug 31, 2018 5:37 am

Re: httpd_register_uri_handler, catch all un-registered requests

Postby ESP_Anurag » Mon Feb 18, 2019 5:41 am

An easy way of handling various HTTP server errors will soon be available. So one can register an error handler for say 404 error, which is generated when requested URI is not found. Till this features is merged you could use the wildcard matching scheme to handle requests to all URIs "/*" other than the valid ones. Make sure to register the valid URIs first and then register handler for "/*"

Who is online

Users browsing this forum: No registered users and 232 guests