Make Apache run our handler hook earlier.

The mod_auth_mellon hook is designed to handle requests to
MellonEndpointPath rather than looking at r->handler.

If we are unlucky, a different handler hook may look at r->handler,
and decide that the request is meant for it instead of mod_auth_mellon.

This patch makes the mod_auth_mellon hook run before most other hooks.

A workaround is to add something like this to the Apache configuration:

<Location /mellon>
  SetHandler mod_auth_mellon
</Location
This commit is contained in:
Olav Morken 2014-08-29 09:33:50 +02:00
parent 6390db7356
commit d97f451eb2
1 changed files with 11 additions and 1 deletions

View File

@ -188,7 +188,17 @@ static void register_hooks(apr_pool_t *p)
ap_hook_check_user_id(am_check_uid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(am_global_init, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_child_init(am_child_init, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_handler(am_handler, NULL, NULL, APR_HOOK_MIDDLE);
/* Add the hook to handle requests to the mod_auth_mellon endpoint.
*
* This is APR_HOOK_FIRST because we do not expect nor require users
* to add a SetHandler option for the endpoint. Instead, simply
* setting MellonEndpointPath should be enough.
*
* Therefore this hook must run before any handler that may check
* r->handler and decide that it is the only handler for this URL.
*/
ap_hook_handler(am_handler, NULL, NULL, APR_HOOK_FIRST);
return;
}