Sort of barely starting to call httpd callbacks with the new implementation.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4686 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-12-21 01:27:57 +00:00
parent f9940fc436
commit 6ecbfe3de6
4 changed files with 68 additions and 7 deletions

View File

@ -96,7 +96,9 @@ bool _http_find_handler(tf_http_t* http, const char* path, tf_http_callback_t**
{
for (int i = 0; i < http->handlers_count; i++)
{
if (!http->handlers[i].pattern || strcmp(path, http->handlers[i].pattern) == 0)
if (!http->handlers[i].pattern ||
strcmp(path, http->handlers[i].pattern) == 0 ||
(strncmp(path, http->handlers[i].pattern, strlen(http->handlers[i].pattern)) == 0 && path[strlen(http->handlers[i].pattern)] == '/'))
{
*out_callback = http->handlers[i].callback;
*out_user_data = http->handlers[i].user_data;