You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/05/02 04:22:58 UTC

Re: [STATUS] Thu May 1 15:22:06 PDT 1997

In message <19...@devsys.jaguNET.com>, Jim Jagielski writes:
>Dean Gaudet wrote:
>> 
>>   * Roy's [PATCH] CGIWrap Problems
>>     <97...@paris.ics.uci.edu>
>>     Status: Roy +1
>
>Could someone resend this one. I missed it. We're running cgiwrap
>here and haven't seen anything weird though :/

And it works without changing?  Does it use FILEPATH_INFO now?

....Roy


Index: util_script.c
===================================================================
RCS file: /export/home/cvs/apache/src/util_script.c,v
retrieving revision 1.56
diff -c -r1.56 util_script.c
*** util_script.c	1997/04/29 04:45:52	1.56
--- util_script.c	1997/04/30 22:21:28
***************
*** 238,243 ****
--- 238,257 ----
      return lu;
  }
  
+ static char *original_uri(request_rec *r)
+ {
+     char *last;
+     char *first = r->the_request;
+ 
+     while (*first && !isspace(*first)) ++first;
+     while (isspace(*first)) ++first;
+ 
+     last = first;
+     while (*last && !isspace(*last)) ++last;
+     
+     return pstrndup(r->pool, first, last - first);
+ }
+ 
  void add_cgi_vars(request_rec *r)
  {
      table *e = r->subprocess_env;
***************
*** 246,252 ****
      table_set (e, "SERVER_PROTOCOL", r->protocol);
      table_set (e, "REQUEST_METHOD", r->method);
      table_set (e, "QUERY_STRING", r->args ? r->args : "");
!     
      /* Note that the code below special-cases scripts run from includes,
       * because it "knows" that the sub_request has been hacked to have the
       * args and path_info of the original request, and not any that may have
--- 260,267 ----
      table_set (e, "SERVER_PROTOCOL", r->protocol);
      table_set (e, "REQUEST_METHOD", r->method);
      table_set (e, "QUERY_STRING", r->args ? r->args : "");
!     table_set (e, "REQUEST_URI", original_uri(r));
! 
      /* Note that the code below special-cases scripts run from includes,
       * because it "knows" that the sub_request has been hacked to have the
       * args and path_info of the original request, and not any that may have
***************
*** 264,283 ****
  
  	table_set (e, "SCRIPT_NAME", pstrndup(r->pool, r->uri,
  					      path_info_start));
! 	table_set (e, "PATH_INFO", r->uri + path_info_start);
      }
  	
-     /* Some CGI apps need the old-style PATH_INFO (taken from the
-      * filename, not the URL), so we provide it in a different env
-      * variable. CGI scripts can use something like (in Perl)
-      * $path_info = $ENV{'FILEPATH_INFO'} || $ENV{'PATH_INFO'};
-      * to get the right information with both old and new
-      * versions of Apache (and other servers).
-      */
- 
-     if (r->path_info && *r->path_info)
- 	table_set (e, "FILEPATH_INFO", r->path_info);
- 
      if (r->path_info && r->path_info[0]) {
  	/*
   	 * To get PATH_TRANSLATED, treat PATH_INFO as a URI path.
--- 279,288 ----
  
  	table_set (e, "SCRIPT_NAME", pstrndup(r->pool, r->uri,
  					      path_info_start));
! 
! 	table_set (e, "PATH_INFO", r->path_info);
      }
  	
      if (r->path_info && r->path_info[0]) {
  	/*
   	 * To get PATH_TRANSLATED, treat PATH_INFO as a URI path.