]> granicus.if.org Git - apache/commitdiff
Fix internal redirects. They should have their own HTTP_HEADER filter
authorRyan Bloom <rbb@apache.org>
Mon, 23 Oct 2000 10:31:44 +0000 (10:31 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 23 Oct 2000 10:31:44 +0000 (10:31 +0000)
instance, and we need to remove the main-request's HTTP_HEADER.

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

modules/http/http_request.c

index 86102cd67d3e017570e69f49be1bea58c0423c95..cf71d3a713a8ede358a47900777206115d2b567e 100644 (file)
@@ -1403,6 +1403,7 @@ static request_rec *internal_internal_redirect(const char *new_uri,
                                               request_rec *r) {
     int access_status;
     core_request_config *req_cfg;
+    ap_filter_t *fdel;
     request_rec *new = (request_rec *) apr_pcalloc(r->pool,
                                                   sizeof(request_rec));
 
@@ -1462,6 +1463,19 @@ 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("HTTP_HEADER", NULL, new, new->connection);
+
+    /* On an internal redirect, the redirect will take care of the headers,
+     * so we have to remove the main-request's HTTP_HEADER filter
+     */
+    fdel = r->output_filters;
+    while (fdel) {
+        if (!strcmp(fdel->frec->name, "HTTP_HEADER")) {
+            ap_remove_output_filter(fdel);
+            break;
+        }
+        fdel = fdel->next;
+    }
 
     apr_table_setn(new->subprocess_env, "REDIRECT_STATUS",
        apr_psprintf(r->pool, "%d", r->status));