Function esp_idf_sys::httpd_uri_match_wildcard

source ·
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
  • /foo/? matches /foo and /foo/
  • /foo/* (sans the backslash) matches /foo/ and /foo/bar, but not /foo or /fo
  • /foo/?* or /foo/*? (sans the backslash) matches /foo/, /foo/bar, and also /foo, but not /foox or /fo

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