]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 308876: Iff ssl is "always", whining (and other non-interactive scripts?) get...
authorlpsolit%gmail.com <>
Thu, 22 Sep 2005 23:57:59 +0000 (23:57 +0000)
committerlpsolit%gmail.com <>
Thu, 22 Sep 2005 23:57:59 +0000 (23:57 +0000)
Bugzilla/CGI.pm
Bugzilla/Util.pm

index 6f5a6f6d75c6b8568b6c83770f1f482120206849..3e86af033f2b5c0d6c6d1d07629cf1110a1f605f 100644 (file)
@@ -55,7 +55,7 @@ sub new {
     $self->charset('');
 
     # Redirect to SSL if required
-    if (Param('sslbase') ne '' and Param('ssl') eq 'always') {
+    if (Param('sslbase') ne '' and Param('ssl') eq 'always' and i_am_cgi()) {
         $self->require_https(Param('sslbase'));
     }
 
index 8887e02d7747f21dca9bf0011919747e0fb3c25e..3374d2c115b9a802feb4c0d49ce8520cca5b64fb 100644 (file)
@@ -33,6 +33,7 @@ use base qw(Exporter);
                              detaint_signed
                              html_quote url_quote value_quote xml_quote
                              css_class_quote
+                             i_am_cgi
                              lsearch max min
                              diff_arrays diff_strings
                              trim wrap_comment find_wrap_point
@@ -130,6 +131,12 @@ sub xml_quote {
     return $var;
 }
 
+sub i_am_cgi {
+    # I use SERVER_SOFTWARE because it's required to be
+    # defined for all requests in the CGI spec.
+    return exists $ENV{'SERVER_SOFTWARE'} ? 1 : 0;
+}
+
 sub lsearch {
     my ($list,$item) = (@_);
     my $count = 0;