[interchange-cvs] [SCM] Interchange branch, master, updated. REL_5_7_3-28-gdc2c39d

Jon Jensen interchange-cvs at icdevgroup.org
Thu Dec 3 19:53:07 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange".

The branch, master has been updated
       via  dc2c39dc1fce05148d0f07f39fa4745604f8c358 (commit)
      from  1c761a2781d9dcb992ba7813805d0c7775529904 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dc2c39dc1fce05148d0f07f39fa4745604f8c358
Author: Jon Jensen <jon at endpoint.com>
Date:   Thu Dec 3 12:51:17 2009 -0700

    Add FullUrlIgnorePort directive
    
    This allows FullUrl to work with nonstandard ports, other than default
    http port 80.

-----------------------------------------------------------------------

Summary of changes and diff:
 lib/Vend/Config.pm   |    1 +
 lib/Vend/Dispatch.pm |   28 +++++++++++++++-------------
 lib/Vend/Server.pm   |    4 +++-
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm
index d7c0e6b..f4a013e 100644
--- a/lib/Vend/Config.pm
+++ b/lib/Vend/Config.pm
@@ -467,6 +467,7 @@ sub global_directives {
 	['GlobalSub',		 'subroutine',       ''],
 	['Database',		 'database',         ''],
 	['FullUrl',			 'yesno',            'No'],
+	['FullUrlIgnorePort', 'yesno',           'No'],
 	['Locale',			 'locale',            ''],
 	['HitCount',		 'yesno',            'No'],
 	['IpHead',			 'yesno',            'No'],
diff --git a/lib/Vend/Dispatch.pm b/lib/Vend/Dispatch.pm
index 378bb9d..55a22e1 100644
--- a/lib/Vend/Dispatch.pm
+++ b/lib/Vend/Dispatch.pm
@@ -920,19 +920,21 @@ sub adjust_cgi {
 
     $CGI::host = $host || $CGI::ip;
 
-    $CGI::user = $CGI::remote_user if $CGI::remote_user;
-	undef $CGI::authorization if $CGI::remote_user;
+    $CGI::user = $CGI::remote_user, undef $CGI::authorization
+        if $CGI::remote_user;
 
-	unless ($Global::FullUrl) {
-		$CGI::script_name = $CGI::script_path;
-	}
-	else {
-		if($CGI::server_port eq '80') { $CGI::server_port = ''; }
-		else 		{ $CGI::server_port = ":$CGI::server_port"; }
-		$CGI::script_name = $CGI::server_name .
-							$CGI::server_port .
-							$CGI::script_path;
-	}
+    if ($Global::FullUrl) {
+        if ($Global::FullUrlIgnorePort or $CGI::server_port eq '80') {
+            $CGI::server_port = '';
+        }
+        else {
+            $CGI::server_port = ":$CGI::server_port";
+        }
+        $CGI::script_name = $CGI::server_name . $CGI::server_port . $CGI::script_path;
+    }
+    else {
+        $CGI::script_name = $CGI::script_path;
+    }
 }
 
 use vars qw/@NoHistory/;
diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm
index af48e5a..854d4e2 100644
--- a/lib/Vend/Server.pm
+++ b/lib/Vend/Server.pm
@@ -181,8 +181,10 @@ sub map_misc_cgi {
 	$CGI::host = $CGI::remote_host || $CGI::remote_addr;
 	$CGI::user = $CGI::remote_user;
 
+	my $server_host_without_port = $CGI::server_host;
+	$server_host_without_port =~ s/:.*// if $Global::FullUrlIgnorePort;
 	$CGI::script_path = $CGI::script_name;
-	$CGI::script_name = $CGI::server_host . $CGI::script_path
+	$CGI::script_name = $server_host_without_port . $CGI::script_path
 		if $Global::FullUrl;
 }
 


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list