Check-in [16ec6e558b]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Always redirect incoming HTTP requests to the /xfer method when the content-type is application/x-fossil.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 16ec6e558bf28c73cc0eeab87aa1618091474fdf
User & Date: drh 2008-05-29 14:00:27.000
Context
2008-05-29
14:37
When redirecting to /xfer, make sure the PATH_INFO actually exists. Update the cgi_replace_parameter() routine to make sure the parameter being replaced already exists. check-in: e5b7292620 user: drh tags: trunk
14:00
Always redirect incoming HTTP requests to the /xfer method when the content-type is application/x-fossil. check-in: 16ec6e558b user: drh tags: trunk
13:05
Updates to the "concepts" document. check-in: 26a2b61dbd user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
693
694
695
696
697
698
699







700
701

702
703
704
705
706
707
708
        add_param_list(z, '&');
      }else{
        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);







    }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
      blob_read_from_channel(&g.cgiIn, g.httpIn, len);

    }
  }

  z = (char*)P("HTTP_COOKIE");
  if( z ){
    z = mprintf("%s",z);
    add_param_list(z, ';');







>
>
>
>
>
>
>


>







693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
        add_param_list(z, '&');
      }else{
        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 ){
    z = mprintf("%s",z);
    add_param_list(z, ';');
Changes to src/xfer.c.
485
486
487
488
489
490
491






492
493
494
495
496
497
498
/*
** If this variable is set, disable login checks.  Used for debugging
** only.
*/
static int disableLogin = 0;

/*






** 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.
*/
void page_xfer(void){







>
>
>
>
>
>







485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/*
** If this variable is set, disable login checks.  Used for debugging
** 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.
*/
void page_xfer(void){