Received: by taz.hyperreal.com (8.6.12/8.6.5) id XAA25208; Tue, 12 Dec 1995 23:14:40 -0800 Received: from krishna.vidya.com by taz.hyperreal.com (8.6.12/8.6.5) with ESMTP id XAA25203; Tue, 12 Dec 1995 23:14:34 -0800 Received: (from myddryn@localhost) by krishna.vidya.com (8.6.12/8.6.9) id XAA12385 for new-httpd@hyperreal.com; Tue, 12 Dec 1995 23:17:40 -0800 From: Adam Sussman Message-Id: <199512130717.XAA12385@krishna.vidya.com> Subject: One more patch for 1.0.0 To: new-httpd@hyperreal.com Date: Tue, 12 Dec 1995 23:17:39 -0800 (PST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2531 Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Hello all, I have a patch for 1.0.0 that I would like to try to get in before the next vote. This patch fixes a bug in mod_dir.c which causes query portions of a request on a directory to be lost via internal redirects. This can be inconveient when redirecting the directory to a script(such as with mod_actions.c) or with SSIs. The following patch to mod_dir.c makes sure that the query is preserved before the redirect occurs. I am including the patch here as I am not sure how else to submit it. Thank you, Adam Sussman Vidya Media Ventures -- snip -- From: asussman@vidya.com (Adam Sussman) Subject: Preserve query portion of URL in mod_dir.c redirects Affects: mod_dir.c ChangeLog: Internal redirects which occur in mod_dir.c do not preserve the query portion of a request (the bit after the question mark). If the directory index is redirected to a script or has an include, the query string is lost before invocation. *** mod_dir.c.old Fri Nov 17 13:33:16 1995 --- mod_dir.c Tue Dec 12 22:35:14 1995 *************** *** 768,774 **** if (r->method_number != M_GET) return NOT_IMPLEMENTED; if (r->uri[0] == '\0' || r->uri[strlen(r->uri)-1] != '/') { ! char* ifile = pstrcat (r->pool, r->uri, "/", NULL); table_set (r->headers_out, "Location", construct_url(r->pool, ifile, r->server)); return REDIRECT; --- 768,780 ---- if (r->method_number != M_GET) return NOT_IMPLEMENTED; if (r->uri[0] == '\0' || r->uri[strlen(r->uri)-1] != '/') { ! char* ifile; ! if (r->args != NULL) ! ifile = pstrcat (r->pool, r->uri, "/", ! "?", r->args, NULL); ! else ! ifile = pstrcat (r->pool, r->uri, "/", NULL); ! table_set (r->headers_out, "Location", construct_url(r->pool, ifile, r->server)); return REDIRECT; *************** *** 787,794 **** request_rec *rr = sub_req_lookup_uri (name_ptr, r); if (rr->status == 200 && rr->finfo.st_mode != 0) { ! char *new_uri = escape_uri(r->pool, rr->uri); destroy_sub_req (rr); internal_redirect (new_uri, r); return OK; } --- 793,807 ---- request_rec *rr = sub_req_lookup_uri (name_ptr, r); if (rr->status == 200 && rr->finfo.st_mode != 0) { ! char* new_uri = escape_uri(r->pool, rr->uri); destroy_sub_req (rr); + + if (r->args!=NULL) + { + char* f = new_uri; + new_uri = pstrcat(r->pool, f, "?", r->args, NULL); + } + internal_redirect (new_uri, r); return OK; }