httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@hyperreal.com>
Subject cvs commit: apache/src mod_asis.c
Date Thu, 16 May 1996 17:11:36 GMT
akosut      96/05/16 10:11:35

  Modified:    src       mod_asis.c
  Log:
  mod_asis used to pass on a Location header that refered to a local
  URL to the client. This is bad for clients (which react differently)
  and unlikely to be the behaviour the user expected. Local redirects
  from .asis are now handled locally (by Apache).
  
  Submitted by: Rob Hartill <hartill@ooo.lanl.gov>
  
  Revision  Changes    Path
  1.4       +17 -0     apache/src/mod_asis.c
  
  Index: mod_asis.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_asis.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -C3 -r1.3 -r1.4
  *** mod_asis.c	1996/03/31 01:07:01	1.3
  --- mod_asis.c	1996/05/16 17:11:34	1.4
  ***************
  *** 62,67 ****
  --- 62,68 ----
    int asis_handler (request_rec *r)
    {
        FILE *f;
  +     char *location;
        
        if (r->method_number != M_GET) return DECLINED;
        if (r->finfo.st_mode == 0) {
  ***************
  *** 77,82 ****
  --- 78,99 ----
        }
          
        scan_script_header (r, f);
  +     location = table_get (r->headers_out, "Location");
  + 
  +     if (location && location[0] == '/' && 
  +         (r->status == 200 || r->status == 301 || r->status == 302)) {
  + 
  +         r->status = 200; /* Assume 200 status on whatever we're pointing to */
  + 
  + 	/* This redirect needs to be a GET no matter what the original
  + 	 * method was.
  + 	*/
  + 	r->method = pstrdup(r->pool, "GET");
  + 	r->method_number = M_GET;
  + 
  + 	internal_redirect_handler (location, r);
  + 	return OK;
  +     }
        
        soft_timeout ("send", r);
        send_http_header (r);
  
  
  

Mime
View raw message