[Rt-commit] rt branch, 4.0/sanity-check-url-config, updated. rt-3.9.7-1138-gd8369fb
Shawn Moore
sartak at bestpractical.com
Fri Jan 7 13:14:37 EST 2011
The branch, 4.0/sanity-check-url-config has been updated
via d8369fb109108b6cd528be10b4e7fc815d21ce1d (commit)
from 3f3daf96f49a2db98c7d66fd87b62f0a5a6cae0e (commit)
Summary of changes:
lib/RT/Config.pm | 5 +++++
t/api/web-config.t | 4 +++-
2 files changed, 8 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit d8369fb109108b6cd528be10b4e7fc815d21ce1d
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Fri Jan 7 13:14:28 2011 -0500
Ensure WebDomain doesn't contain a port
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index cc6be20..c38931b 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -581,6 +581,11 @@ our %META = (
$RT::Logger->error("The WebDomain config option must not contain a path ($1)");
return;
}
+
+ if ($value =~ m{:(\d*)}) {
+ $RT::Logger->error("The WebDomain config option must not contain a port ($1)");
+ return;
+ }
},
},
WebPort => {
diff --git a/t/api/web-config.t b/t/api/web-config.t
index 4a4f5c3..fb2b362 100644
--- a/t/api/web-config.t
+++ b/t/api/web-config.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use RT;
-use RT::Test nodb => 1, tests => 87;
+use RT::Test nodb => 1, tests => 89;
sub no_warnings_ok {
local $Test::Builder::Level = $Test::Builder::Level + 1;
@@ -85,6 +85,8 @@ one_warning_like(WebDomain => 'rt.example.com/path', qr{The WebDomain config opt
one_warning_like(WebDomain => 'rt.example.com/path/more', qr{The WebDomain config option must not contain a path \(/path/more\)});
+one_warning_like(WebDomain => 'rt.example.com:80', qr{The WebDomain config option must not contain a port \(80\)});
+
# reinstate a valid WebDomain for other tests
no_warnings_ok(WebDomain => 'rt.example.com');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list