- pthread_rwlock_rdlock(&rwlock);
- hook = list_of_xreq_hooks;
- while (hook) {
- f = hook->flags & afb_hook_flags_req_all;
- add = f != 0
- && (!hook->session || hook->session == xreq->context.session)
- && (!hook->api || !strcasecmp(hook->api, xreq->api))
- && (!hook->verb || !strcasecmp(hook->verb, xreq->verb));
- if (add)
- flags |= f;
- hook = hook->next;
+ if (afb_api_is_hookable(xreq->request.api)) {
+ pthread_rwlock_rdlock(&rwlock);
+ hook = list_of_xreq_hooks;
+ while (hook) {
+ f = hook->flags & afb_hook_flags_req_all;
+ add = f != 0
+ && (!hook->session || hook->session == xreq->context.session)
+ && (!hook->api || !strcasecmp(hook->api, xreq->request.api))
+ && (!hook->verb || !strcasecmp(hook->verb, xreq->request.verb));
+ if (add)
+ flags |= f;
+ hook = hook->next;
+ }
+ pthread_rwlock_unlock(&rwlock);