]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Move the addition of default AP_HTTP_HTTP_HEADER filters to the insert_filter
authorGraham Leggett <minfrin@apache.org>
Mon, 21 May 2001 23:47:21 +0000 (23:47 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 21 May 2001 23:47:21 +0000 (23:47 +0000)
phase so that other filters are not bypassed by default.
PR:
Obtained from:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89196 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_core.c
modules/http/http_request.c
modules/metadata/mod_headers.c
server/protocol.c

index f59e2533d309a0c1497ebb6383e18ab2ccc6a0ac..e3f2c1e496e74f4d1d26b1290bbe7f7a00b7a258 100644 (file)
@@ -295,6 +295,13 @@ static int ap_process_http_connection(conn_rec *c)
     return OK;
 }
 
+static void ap_http_insert_filter(request_rec *r)
+{
+    ap_add_output_filter("BYTERANGE", NULL, r, r->connection);
+    ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
+    ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
+}
+
 static void register_hooks(apr_pool_t *p)
 {
     ap_hook_pre_connection(ap_pre_http_connection,NULL,NULL,
@@ -304,6 +311,7 @@ static void register_hooks(apr_pool_t *p)
     ap_hook_http_method(http_method,NULL,NULL,APR_HOOK_REALLY_LAST);
     ap_hook_default_port(http_port,NULL,NULL,APR_HOOK_REALLY_LAST);
 
+    ap_hook_insert_filter(ap_http_insert_filter, NULL, NULL, APR_HOOK_REALLY_LAST);
     ap_register_input_filter("HTTP_IN", ap_http_filter, AP_FTYPE_CONNECTION);
     ap_register_input_filter("DECHUNK", ap_dechunk_filter, AP_FTYPE_TRANSCODE);
     ap_register_output_filter("HTTP_HEADER", ap_http_header_filter, 
index 95c353b6f12d6a39b6eeac82a9fab4165713fae2..735c1e6d72bf74bf102f1187b462c8fa552e470d 100644 (file)
@@ -517,10 +517,6 @@ static request_rec *internal_internal_redirect(const char *new_uri,
     new->output_filters  = r->connection->output_filters;
     new->input_filters   = r->connection->input_filters;
 
-    ap_add_output_filter("BYTERANGE", NULL, new, new->connection);
-    ap_add_output_filter("CONTENT_LENGTH", NULL, new, new->connection);
-    ap_add_output_filter("HTTP_HEADER", NULL, new, new->connection);
-
     apr_table_setn(new->subprocess_env, "REDIRECT_STATUS",
        apr_psprintf(r->pool, "%d", r->status));
 
index 8c90e23d90fcb733fe216a5db74972aae53fcd75..d9a8a5e7bf298f3eacddc3d7a5fac833fec64412 100644 (file)
@@ -231,7 +231,7 @@ static const char *header_cmd(cmd_parms *cmd, void *indirconf,
 }
 
 /* handle RequestHeader directive */
-static const char *header_in_cmd(cmd_parms *cmd, void *indirconf,
+static const char *request_header_cmd(cmd_parms *cmd, void *indirconf,
                               const char *action, const char *inhdr,
                               const char *value)
 {
@@ -317,7 +317,7 @@ static const command_rec headers_cmds[] =
 {
     AP_INIT_TAKE23("Header", header_cmd, NULL, OR_FILEINFO,
                    "an action, header and value"),
-    AP_INIT_TAKE23("RequestHeader", header_in_cmd, NULL, OR_FILEINFO,
+    AP_INIT_TAKE23("RequestHeader", request_header_cmd, NULL, OR_FILEINFO,
                    "an action, header and value"),
     {NULL}
 };
@@ -326,7 +326,7 @@ static void register_hooks(apr_pool_t *p)
 {
     ap_hook_insert_filter(ap_headers_insert_output_filter, NULL, NULL, APR_HOOK_LAST);
     ap_hook_fixups(ap_headers_fixup, NULL, NULL, APR_HOOK_LAST);
-    ap_register_output_filter("FIXUP_HEADERS_OUT", ap_headers_output_filter, AP_FTYPE_CONTENT);
+    ap_register_output_filter("FIXUP_HEADERS_OUT", ap_headers_output_filter, AP_FTYPE_HTTP_HEADER);
 }
 
 module AP_MODULE_DECLARE_DATA headers_module =
index 1842a7ebbb499d702ced97d0620e030176503612..28bb4dec5f78a1b86f35e6959993c93844ca2739 100644 (file)
@@ -590,10 +590,6 @@ request_rec *ap_read_request(conn_rec *conn)
                      ? r->server->keep_alive_timeout * APR_USEC_PER_SEC
                      : r->server->timeout * APR_USEC_PER_SEC));
                      
-    ap_add_output_filter("BYTERANGE", NULL, r, r->connection);
-    ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
-    ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
-
     /* Get the request... */
     if (!read_request_line(r)) {
         if (r->status == HTTP_REQUEST_URI_TOO_LARGE) {