themselves during processing of error responses. Enable mod_expires
to use the new hook to include Expires headers in valid error
responses. This addresses an RFC violation. It fixes PRs 19794,
24884, and 25123. [Paul J. Reder]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102038
13f79535-47bb-0310-9956-
ffa450edef68
[Remove entries to the current 2.0 section below, when backported]
+ *) Add a hook (insert_error_filter) to allow filters to re-insert
+ themselves during processing of error responses. Enable mod_expires
+ to use the new hook to include Expires headers in valid error
+ responses. This addresses an RFC violation. It fixes PRs 19794,
+ 24884, and 25123. [Paul J. Reder]
+
*) Fix <Limit> and <LimitExcept> parsing to require a closing '>'
in the initial container. PR 25414.
[Geoffrey Young <geoff apache.org>]
* @package HTTP protocol handling
*/
+/**
+ * This hook allows modules to insert filters for the current error response
+ * @param r the current request
+ * @ingroup hooks
+ */
+AP_DECLARE_HOOK(void,insert_error_filter,(request_rec *r))
+
/* This is an optimization. We keep a record of the filter_rec that
* stores the old_write filter, so that we can avoid strcmp's later.
*/
"510 Not Extended"
};
+APR_HOOK_STRUCT(
+ APR_HOOK_LINK(insert_error_filter)
+)
+
+AP_IMPLEMENT_HOOK_VOID(insert_error_filter, (request_rec *r), (r))
/* The index of the first bit field that is used to index into a limit
* bitmask. M_INVALID + 1 to METHOD_NUMBER_LAST.
r->output_filters = r->proto_output_filters;
+ ap_run_insert_error_filter(r);
+
/*
* It's possible that the Location field might be in r->err_headers_out
* instead of r->headers_out; use the latter if possible, else the
#include "http_config.h"
#include "http_log.h"
#include "http_request.h"
+#include "http_protocol.h"
typedef struct {
int active;
{
ap_register_output_filter("MOD_EXPIRES", expires_filter, NULL,
AP_FTYPE_CONTENT_SET);
+ ap_hook_insert_error_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_insert_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
}