httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch>
Subject Revisiting the pre_htaccess hook
Date Sun, 09 Jun 2013 09:57:54 GMT

first of all, sorry that it took me so long to review at this.

The current pre_access hook is executed before opening the htaccess 
and then can abort the request with a HTTP error code.

Wouldn't a hook for opening the htaccess file make more sense because 
it would have more possible use cases? Then modules could use this 
hook to find htaccess files somewhere else, generate/extend/filter 
them on the fly, etc. For example:

apr_status_t  ap_run_open_htaccess(request_rec *r, ap_configfile_t *f, 
const char **full_name, const char *dirname, const char *accessname);

The hook would then build full_name (used later for error logging) 
from dirname and accessname and open it with ap_pcfg_openfile().

Downside would be that the hook cannot provide an arbitrary HTTP 
status code. Only no error and FORBIDDEN. Would that be a problem?

We could add an additional int *request_status parameter, too, though.
Or put the error logging/generating of FORBIDDEN into core's 
open_htaccess hook function and make the hook return HTTP status and 
not apr_status_t.

What do you think?


View raw message