cambridgeuniversity / mod_ucam_webauth

Ucam WebAuth Apache authentication agent (mod_ucam_webauth)
GNU Lesser General Public License v2.1
7 stars 9 forks source link

make ErrorDocument 401 work again in Apache 2.4.13 and later #15

Closed mgkuhn closed 7 years ago

mgkuhn commented 7 years ago

Apache 2.4.13 changed the data structure used to hold ErrorDocument entries from the array of strings conf->response_code_strings to the hash table of compiled expressions conf->response_code_exprs instead. This patch updates wls_response_code_string() accordingly, such that ErrorDocument directives now also work again in Apache 2.4.13 and later. Fixes #11.

Note:

Ideally, wls_response_code_string() should also return NULL if the hash lookup returns &errordocument_default. But sadly Apache declares errordocument_default to be static in server/core.c, so there seems no obvious way to test for this without first patching Apache. As a result, "Errordocument 401 default" will result in the default message of Apache, not in that of mod_ucam_webauth.

jw35 commented 7 years ago

Excellent, thanks for fixing this.

Could you bump the version number in mod_ucam_webauth.c to 2.0.4 and add an entry to the CHANGES file and I'll merge this request?

mgkuhn commented 7 years ago

The current tar/rpm/etc. release is 2.0.2, and there have been no other commits on master between the upgrade of VERSION from 2.0.2 (61a60f65038c) to 2.0.3 (376bfbc3ef36) by mcv21 in March 2015, so I would have expected the next release to be called 2.0.3.

mgkuhn commented 7 years ago

Ah, sorry, I now spotted Ubuntu packaging changes between 2.0.2 and 2.0.3, so have bumped version to 2.0.4, as requested.

I also offer some cosmetic updates: