httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] PR#293: preserve QUERY_STRING in Redirect
Date Fri, 11 Apr 1997 22:07:46 GMT
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;
      }
      



Mime
View raw message