Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #196 from jhrozek/am_handler_except_proxy
Browse files Browse the repository at this point in the history
Modify am_handler setup to run before mod_proxy
  • Loading branch information
olavmrk authored Mar 19, 2019
2 parents 881d11c + e09a28a commit 7bc4367
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mod_auth_mellon.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ static int am_create_request(request_rec *r)

static void register_hooks(apr_pool_t *p)
{
/* Our handler needs to run before mod_proxy so that it can properly
* return ECP AuthnRequest messages when running as a reverse proxy.
* See: https://github.com/Uninett/mod_auth_mellon/pull/196
*/
static const char * const run_handler_before[]={ "mod_proxy.c", NULL };

ap_hook_access_checker(am_auth_mellon_user, NULL, NULL, APR_HOOK_MIDDLE);
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);
Expand All @@ -222,7 +228,7 @@ static void register_hooks(apr_pool_t *p)
* 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);
ap_hook_handler(am_handler, NULL, run_handler_before, APR_HOOK_FIRST);

#ifdef ENABLE_DIAGNOSTICS
ap_hook_open_logs(am_diag_log_init,NULL,NULL,APR_HOOK_MIDDLE);
Expand Down

0 comments on commit 7bc4367

Please sign in to comment.