summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgmi.pl36
1 files changed, 21 insertions, 15 deletions
diff --git a/gmi.pl b/gmi.pl
index 8381ecf..246b809 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -7,7 +7,7 @@ use warnings;
use 5.010;
#use diagnostics;
-our $VERSION = 'v0.17.1';
+our $VERSION = 'v0.17.2';
# Modules
use IO::Socket::SSL; # CPAN
@@ -1092,18 +1092,19 @@ sub redirection_parameter {
$vhost = 'default';
}
- ## no critic (cascading)
- if ($r eq 'no') {
- return 0;
- }
- elsif ($r eq 'simple') {
- return 1;
- }
- elsif ($r eq 'regex') {
- return 2;
- }
- elsif ($r) {
- serr("'$vhost': Given redirection parameter is invalid: $r");
+ if ($r) {
+ if ($r eq 'no') {
+ return 0;
+ }
+ elsif ($r eq 'simple') {
+ return 1;
+ }
+ elsif ($r eq 'regex') {
+ return 2;
+ }
+ else {
+ serr("'$vhost': Given redirection parameter is invalid: $r");
+ }
}
return;
@@ -1200,8 +1201,13 @@ sub cert_req {
}
}
# must be string, hopefully 'any'
- elsif ($cert_req->{$key} eq 'any' and defined $cl_cert) {
- return 0;
+ elsif ($cert_req->{$key} eq 'any') {
+ if (defined $cl_cert) {
+ return 0;
+ }
+ else {
+ return 1;
+ }
}
else {
serr("'$vhost': certs: when not an array, it must be 'any'.");