pub unsafe extern "C" fn httpd_uri_match_wildcard(
uri_template: *const c_char,
uri_to_match: *const c_char,
match_upto: usize,
) -> bool
Expand description
@brief Test if a URI matches the given wildcard template.
Template may end with “?” to make the previous character optional (typically a slash), “” for a wildcard match, and “?” to make the previous character optional, and if present, allow anything to follow.
Example:
-
- matches everything
- /api/? matches /api and /api/
- /api/* (sans the backslash) matches /api/ and /api/status, but not /api or /ap
- /api/?* or /api/*? (sans the backslash) matches /api/, /api/status, and also /api, but not /apix or /ap
The special characters “?” and “*” anywhere else in the template will be taken literally.
@param[in] uri_template URI template (pattern) @param[in] uri_to_match URI to be matched @param[in] match_upto how many characters of the URI buffer to test (there may be trailing query string etc.)
@return true if a match was found