* Return true if the specified HTTP method is in the provided * method list. */
| 1579 | * method list. |
| 1580 | */ |
| 1581 | AP_DECLARE(int) ap_method_in_list(ap_method_list_t *l, const char *method) |
| 1582 | { |
| 1583 | int methnum; |
| 1584 | |
| 1585 | /* |
| 1586 | * If it's one of our known methods, use the shortcut and check the |
| 1587 | * bitmask. |
| 1588 | */ |
| 1589 | methnum = ap_method_number_of(method); |
| 1590 | if (methnum != M_INVALID) { |
| 1591 | return !!(l->method_mask & (AP_METHOD_BIT << methnum)); |
| 1592 | } |
| 1593 | /* |
| 1594 | * Otherwise, see if the method name is in the array of string names. |
| 1595 | */ |
| 1596 | if ((l->method_list == NULL) || (l->method_list->nelts == 0)) { |
| 1597 | return 0; |
| 1598 | } |
| 1599 | |
| 1600 | return ap_array_str_contains(l->method_list, method); |
| 1601 | } |
| 1602 | |
| 1603 | /* |
| 1604 | * Add the specified method to a method list (if it isn't already there). |
nothing calls this directly
no test coverage detected