[Rt-commit] rt branch, 4.0/spurious-port-warning, created. rt-4.0.1rc1-37-g59f6a8b

Shawn Moore sartak at bestpractical.com
Thu Jun 9 17:59:33 EDT 2011


The branch, 4.0/spurious-port-warning has been created
        at  59f6a8b7279397c343cc108d5129bf774828588a (commit)

- Log -----------------------------------------------------------------
commit 59f6a8b7279397c343cc108d5129bf774828588a
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jun 9 17:50:07 2011 -0400

    Only warn about port config if you haven't passed a --port to rt-server
    
        This silences a spurious warning which can occur when you have
        a setup like the following:
    
        * a starlet serving internal, proxied requests on port 9999 by using
          --port 9999
        * an apache serving user-facing requests at port 80 by proxying them
          to the starlet on port 9999
        * a WebPort of 80
    
        This means that you would be directed to Set($WebPort, 80),
        since 9999(explicit_port) != 80(SERVER_PORT), even though you
        already have Set($WebPort, 80)!
    
        Now we never warn if you pass an explicit --port, since that port is
        used either for internal IPC OR serving user-facing requests (which
        does not use the port to generate links)

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 11ba877..50fcc80 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1075,15 +1075,8 @@ sub ValidateWebConfig {
     return if $_has_validated_web_config;
     $_has_validated_web_config = 1;
 
-    if ($ENV{'rt.explicit_port'}) {
-        if ($ENV{SERVER_PORT} != $ENV{'rt.explicit_port'}) {
-            $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the requested port ($ENV{'rt.explicit_port'}). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}); in RT_SiteConfig.pm, otherwise your internal links may be broken.");
-        }
-    }
-    else {
-        if ($ENV{SERVER_PORT} != RT->Config->Get('WebPort')) {
-            $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the configured WebPort ($RT::WebPort). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}); in RT_SiteConfig.pm, otherwise your internal links may be broken.");
-        }
+    if (!$ENV{'rt.explicit_port'} && $ENV{SERVER_PORT} != RT->Config->Get('WebPort')) {
+        $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the configured WebPort ($RT::WebPort). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}); in RT_SiteConfig.pm, otherwise your internal links may be broken.");
     }
 
     if ($ENV{HTTP_HOST}) {

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


More information about the Rt-commit mailing list