[interchange-cvs] interchange - heins modified 2 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sun Feb 29 15:41:40 EST 2004
User: heins
Date: 2004-02-29 20:41:40 GMT
Modified: lib/Vend Dispatch.pm Server.pm
Log:
* When no PATH_INFO is specified, normally we go to find_special_page('catalog').
This change checks the REQUEST_URI when that condition occurs, and if
the REQUEST_URI doesn't begin with SCRIPT_PATH we assume the web server
has used the Interchange SCRIPT_PATH as the index entry in DirectoryIndex.
This allows in (at least Apache's) httpd.conf:
DirectoryIndex index.html /cgi-bin/foundation
When the index.html page is not found, /cgi-bin/foundation is called.
If the URI is a subdirectory as in the request /foo/, then the REQUEST_URI
will be /foo/. We then use /foo/ as the Interchange path, allowing
transparent flowthrough of non-existent entries to Interchange.
In other words, you can create an empty directory /var/www/html/foo,
and when /foo/ comes in as a request it will automatically go to
/cgi-bin/foundation/foo/ while still appearing to be /foo/ on the
browser.
If you combine this with the following in catalog.cfg:
DirectoryIndex index.html
DeliverImage yes
And the following in interchange.cfg:
AcceptRedirect Yes
And finally:
<LocationMatch "^/(.*)/.*\.html">
ErrorDocument 404 /cgi-bin/foundation
</LocationMatch>
you can run a complete set of
Revision Changes Path
1.34 +10 -3 interchange/lib/Vend/Dispatch.pm
rev 1.34, prev_rev 1.33
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Dispatch.pm 24 Feb 2004 20:53:58 -0000 1.33
+++ Dispatch.pm 29 Feb 2004 20:41:40 -0000 1.34
@@ -1,6 +1,6 @@
# Vend::Dispatch - Handle Interchange page requests
#
-# $Id: Dispatch.pm,v 1.33 2004/02/24 20:53:58 mheins Exp $
+# $Id: Dispatch.pm,v 1.34 2004/02/29 20:41:40 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
package Vend::Dispatch;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.33 $, 10);
+$VERSION = substr(q$Revision: 1.34 $, 10);
use POSIX qw(strftime);
use Vend::Util;
@@ -1440,7 +1440,14 @@
# If the cgi-bin program was invoked with no extra path info,
# just display the catalog page.
if (! $Vend::FinalPath || $Vend::FinalPath =~ m:^/+$:) {
- $Vend::FinalPath = find_special_page('catalog');
+#::logDebug("request_uri=$CGI::request_uri script_path=$CGI::script_path");
+ if($CGI::request_uri !~ /^$CGI::script_path/) {
+ $Vend::FinalPath = $CGI::request_uri;
+#::logDebug("FinalPath now $CGI::request_uri");
+ }
+ else {
+ $Vend::FinalPath = find_special_page('catalog');
+ }
}
if($CGI::put_ref and my $act = $Vend::Cfg->{Special}{put_handler} ) {
2.48 +3 -2 interchange/lib/Vend/Server.pm
rev 2.48, prev_rev 2.47
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.47
retrieving revision 2.48
diff -u -r2.47 -r2.48
--- Server.pm 2 Feb 2004 09:23:37 -0000 2.47
+++ Server.pm 29 Feb 2004 20:41:40 -0000 2.48
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.47 2004/02/02 09:23:37 racke Exp $
+# $Id: Server.pm,v 2.48 2004/02/29 20:41:40 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
package Vend::Server;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.47 $, 10);
+$VERSION = substr(q$Revision: 2.48 $, 10);
use POSIX qw(setsid strftime);
use Vend::Util;
@@ -73,6 +73,7 @@
remote_host REMOTE_HOST
remote_user REMOTE_USER
request_method REQUEST_METHOD
+ request_uri REQUEST_URI
script_name SCRIPT_NAME
secure HTTPS
server_name SERVER_NAME
More information about the interchange-cvs
mailing list