Skip to content

Commit

Permalink
Item10551: Fix HttpsRedirectPlugin breaking CLI usage of bin scripts
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/HttpsRedirectPlugin@11241 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Mar 27, 2011
1 parent ed4ad60 commit 653298e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Foswiki/Plugins/HttpsRedirectPlugin.pm
Expand Up @@ -146,7 +146,7 @@ sub initPlugin {
{

#Build up our URL
my $query = &Foswiki::Func::getCgiQuery();
my $query = Foswiki::Func::getCgiQuery();
my $url = $query->url() . $query->path_info();
if ( $query->query_string() ) {
$url .= '?' . $query->query_string();
Expand All @@ -172,13 +172,15 @@ sub initPlugin {
#If the user is no guest always force HTTPS

#Get our URL
my $query = &Foswiki::Func::getCgiQuery();
my $query = Foswiki::Func::getCgiQuery();
my $url = $query->url() . $query->path_info();
if ( $query->query_string() ) {
$url .= '?' . $query->query_string();
}

unless ( $url =~ /^https/ ) #Unless we are already using HTTPS
#Unless we are already using HTTPS, or running from CLI
unless ( $url =~ /^https/
or Foswiki::Func::getContext()->{'command_line'} )
{

#Redirect to HTTPS URL and quite
Expand Down

0 comments on commit 653298e

Please sign in to comment.