http: Add a more expressive but still nowhere near regex URL pattern matcher.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 14m57s

This commit is contained in:
2024-11-02 19:22:04 -04:00
parent f74ca1c236
commit a09fefab5e
3 changed files with 54 additions and 13 deletions

View File

@ -228,4 +228,12 @@ void tf_http_request_websocket_upgrade(tf_http_request_t* request);
*/
const char* tf_http_status_text(int status);
/**
** Match URL patterns. "*" matches anything, and "{word}" matches [a-zA-Z][a-zA-Z0-9]*".
** @param pattern The pattern to match.
** @param path The path to test.
** @return true if the path matches the pattern.
*/
bool tf_http_pattern_matches(const char* pattern, const char* path);
/** @} */