Fossil SCM

Always redirect incoming HTTP requests to the /xfer method when the content-type is application/x-fossil.

drh 2008-05-29 14:00 trunk
Commit 16ec6e558bf28c73cc0eeab87aa1618091474fdf
2 files changed +8 +6
+8
--- src/cgi.c
+++ src/cgi.c
@@ -695,12 +695,20 @@
695695
process_multipart_form_data(z, len);
696696
}
697697
}else if( strcmp(zType, "application/x-fossil")==0 ){
698698
blob_read_from_channel(&g.cgiIn, g.httpIn, len);
699699
blob_uncompress(&g.cgiIn, &g.cgiIn);
700
+ /* If the content type is application/x-fossil, then ignore
701
+ ** the path in the first line of the HTTP header and always
702
+ ** use the /xfer method since the /xfer method is the only
703
+ ** method that understands the application/x-fossil content
704
+ ** type.
705
+ */
706
+ cgi_replace_parameter("PATH_INFO", "/xfer");
700707
}else if( strcmp(zType, "application/x-fossil-debug")==0 ){
701708
blob_read_from_channel(&g.cgiIn, g.httpIn, len);
709
+ cgi_replace_parameter("PATH_INFO", "/xfer"); /* See comment above */
702710
}
703711
}
704712
705713
z = (char*)P("HTTP_COOKIE");
706714
if( z ){
707715
--- src/cgi.c
+++ src/cgi.c
@@ -695,12 +695,20 @@
695 process_multipart_form_data(z, len);
696 }
697 }else if( strcmp(zType, "application/x-fossil")==0 ){
698 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
699 blob_uncompress(&g.cgiIn, &g.cgiIn);
 
 
 
 
 
 
 
700 }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
701 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
 
702 }
703 }
704
705 z = (char*)P("HTTP_COOKIE");
706 if( z ){
707
--- src/cgi.c
+++ src/cgi.c
@@ -695,12 +695,20 @@
695 process_multipart_form_data(z, len);
696 }
697 }else if( strcmp(zType, "application/x-fossil")==0 ){
698 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
699 blob_uncompress(&g.cgiIn, &g.cgiIn);
700 /* If the content type is application/x-fossil, then ignore
701 ** the path in the first line of the HTTP header and always
702 ** use the /xfer method since the /xfer method is the only
703 ** method that understands the application/x-fossil content
704 ** type.
705 */
706 cgi_replace_parameter("PATH_INFO", "/xfer");
707 }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
708 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
709 cgi_replace_parameter("PATH_INFO", "/xfer"); /* See comment above */
710 }
711 }
712
713 z = (char*)P("HTTP_COOKIE");
714 if( z ){
715
+6
--- src/xfer.c
+++ src/xfer.c
@@ -487,10 +487,16 @@
487487
** only.
488488
*/
489489
static int disableLogin = 0;
490490
491491
/*
492
+** The CGI/HTTP preprocessor always redirects requests with a content-type
493
+** of application/x-fossil or application/x-fossil-debug to this page,
494
+** regardless of what path was specified in the HTTP header. This allows
495
+** clone clients to specify a URL that omits default pathnames, such
496
+** as "http://fossil-scm.morg/" instead of "http://fossil-scm.org/index.cgi".
497
+**
492498
** WEBPAGE: xfer
493499
**
494500
** This is the transfer handler on the server side. The transfer
495501
** message has been uncompressed and placed in the g.cgiIn blob.
496502
** Process this message and form an appropriate reply.
497503
--- src/xfer.c
+++ src/xfer.c
@@ -487,10 +487,16 @@
487 ** only.
488 */
489 static int disableLogin = 0;
490
491 /*
 
 
 
 
 
 
492 ** WEBPAGE: xfer
493 **
494 ** This is the transfer handler on the server side. The transfer
495 ** message has been uncompressed and placed in the g.cgiIn blob.
496 ** Process this message and form an appropriate reply.
497
--- src/xfer.c
+++ src/xfer.c
@@ -487,10 +487,16 @@
487 ** only.
488 */
489 static int disableLogin = 0;
490
491 /*
492 ** The CGI/HTTP preprocessor always redirects requests with a content-type
493 ** of application/x-fossil or application/x-fossil-debug to this page,
494 ** regardless of what path was specified in the HTTP header. This allows
495 ** clone clients to specify a URL that omits default pathnames, such
496 ** as "http://fossil-scm.morg/" instead of "http://fossil-scm.org/index.cgi".
497 **
498 ** WEBPAGE: xfer
499 **
500 ** This is the transfer handler on the server side. The transfer
501 ** message has been uncompressed and placed in the g.cgiIn blob.
502 ** Process this message and form an appropriate reply.
503

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button