Check-in [16ec6e558b]
Not logged in
Overview

SHA1 Hash:16ec6e558bf28c73cc0eeab87aa1618091474fdf
Date: 2008-05-29 14:00:27
User: drh
Comment:Always redirect incoming HTTP requests to the /xfer method when the content-type is application/x-fossil.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/cgi.c from [98e61aaa4c] to [7e3878f313].

@@ -695,12 +695,20 @@
         process_multipart_form_data(z, len);
       }
     }else if( strcmp(zType, "application/x-fossil")==0 ){
       blob_read_from_channel(&g.cgiIn, g.httpIn, len);
       blob_uncompress(&g.cgiIn, &g.cgiIn);
+      /* If the content type is application/x-fossil, then ignore
+      ** the path in the first line of the HTTP header and always
+      ** use the /xfer method since the /xfer method is the only
+      ** method that understands the application/x-fossil content
+      ** type.
+      */
+      cgi_replace_parameter("PATH_INFO", "/xfer");
     }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
       blob_read_from_channel(&g.cgiIn, g.httpIn, len);
+      cgi_replace_parameter("PATH_INFO", "/xfer");  /* See comment above */
     }
   }
 
   z = (char*)P("HTTP_COOKIE");
   if( z ){

Modified src/xfer.c from [77caa45410] to [e9c8669cb1].

@@ -487,10 +487,16 @@
 ** only.
 */
 static int disableLogin = 0;
 
 /*
+** The CGI/HTTP preprocessor always redirects requests with a content-type
+** of application/x-fossil or application/x-fossil-debug to this page,
+** regardless of what path was specified in the HTTP header.  This allows
+** clone clients to specify a URL that omits default pathnames, such
+** as "http://fossil-scm.morg/" instead of "http://fossil-scm.org/index.cgi".
+**
 ** WEBPAGE: xfer
 **
 ** This is the transfer handler on the server side.  The transfer
 ** message has been uncompressed and placed in the g.cgiIn blob.
 ** Process this message and form an appropriate reply.