You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/04/12 00:07:46 UTC

[PATCH] PR#293: preserve QUERY_STRING in Redirect

This patch preserves ?query_string args across Redirects.  i.e. "Redirect
/cgi-bin http://somewhere-else/cgi-bin" and this'll redirect
/cgi-bin/foo?bar to http://somewhere-else/cgi-bin/foo?bar.

Dean

Index: mod_alias.c
===================================================================
RCS file: /hot/repository/apache/src/mod_alias.c,v
retrieving revision 1.15
diff -c -3 -r1.15 mod_alias.c
*** mod_alias.c	1997/03/18 04:32:50	1.15
--- mod_alias.c	1997/04/11 07:15:38
***************
*** 272,279 ****
          return DECLINED;
  
      if ((ret = try_alias_list (r, serverconf->redirects, 1, &status)) != NULL) {
! 	if (is_HTTP_REDIRECT(status))
  	    table_set (r->headers_out, "Location", ret);
          return status;
      }
      
--- 272,284 ----
          return DECLINED;
  
      if ((ret = try_alias_list (r, serverconf->redirects, 1, &status)) != NULL) {
! 	if (is_HTTP_REDIRECT(status)) {
! 	    /* include QUERY_STRING if any */
! 	    if (r->args) {
! 		ret = pstrcat (r->pool, ret, "?", r->args, NULL);
! 	    }
  	    table_set (r->headers_out, "Location", ret);
+ 	}
          return status;
      }