]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Clean up breakage introduced recently that sent the wrong headers through
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 5 Apr 2002 20:06:52 +0000 (20:06 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 5 Apr 2002 20:06:52 +0000 (20:06 +0000)
  the http_headers output filter.  Now we will always point every filter at
  the 'redirected' request, e.g. the actual error message response rather
  than the request that failed.

Reviewed by: JimJag, Rbb, DougM

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

modules/http/http_request.c

index 7d3f82e3f1938d8398872835dd4952b4a3ae4e3d..9eabe3b56c3e4ad1b441abd75163b3d54d1d804d 100644 (file)
@@ -305,6 +305,7 @@ static apr_table_t *rename_original_env(apr_pool_t *p, apr_table_t *t)
 static request_rec *internal_internal_redirect(const char *new_uri,
                                               request_rec *r) {
     int access_status;
+    ap_filter_t *f;
     request_rec *new = (request_rec *) apr_pcalloc(r->pool,
                                                   sizeof(request_rec));
 
@@ -370,6 +371,22 @@ static request_rec *internal_internal_redirect(const char *new_uri,
     new->output_filters  = new->proto_output_filters;
     new->input_filters   = new->proto_input_filters;
 
+    f = new->input_filters;
+    while (f) {
+        if (f->r == r) {
+            f->r = new;
+        }
+        f = f->next;
+    }
+
+    f = new->output_filters;
+    while (f) {
+        if (f->r == r) {
+            f->r = new;
+        }
+        f = f->next;
+    }
+
     ap_add_input_filter("HTTP_IN", NULL, new, new->connection);
 
     apr_table_setn(new->subprocess_env, "REDIRECT_STATUS",