Avoid uninit value warning when testing for HTTPS
authorJeff Godin <jgodin@tadl.org>
Wed, 2 Oct 2013 16:09:42 +0000 (12:09 -0400)
committerJeff Godin <jgodin@tadl.org>
Wed, 2 Oct 2013 16:09:42 +0000 (12:09 -0400)
Avoid an uninitialized value warning for testing for HTTPS.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
iNCIPit.cgi

index b4278ec..fe57d1a 100644 (file)
@@ -51,7 +51,7 @@ if ($conf->{behavior}->{patron_id_as_identifier} =~ m/^yes$/i) {
 
 # reject non-https access unless configured otherwise
 unless ($conf->{access}->{permit_plaintext} =~ m/^yes$/i) {
-    unless ($ENV{HTTPS} eq 'on') {
+    unless (defined($ENV{HTTPS}) && $ENV{HTTPS} eq 'on') {
         print "Content-type: text/plain\n\n";
         print "Access denied.\n";
         exit 0;