aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App.pm7
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm9
2 files changed, 10 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 0d3b024a8..7922dfea1 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -94,8 +94,11 @@ __PACKAGE__->setup();
# tell the code we're secure if we are.
after 'prepare_headers' => sub {
my $self = shift;
- $self->req->secure( 1 ) if $self->config->{BASE_URL} eq 'https://www.zueriwieneu.ch';
- $self->req->secure( 1 ) if $self->config->{BASE_URL} eq 'http://www.fixmystreet.com' && $self->req->headers->header('Host') eq 'fix.bromley.gov.uk';
+ my $base_url = $self->config->{BASE_URL};
+ my $host = $self->req->headers->header('Host');
+ $self->req->secure( 1 ) if $base_url eq 'https://www.zueriwieneu.ch';
+ $self->req->secure( 1 ) if $base_url eq 'https://www.fixmystreet.com'
+ && ( $host eq 'fix.bromley.gov.uk' || $host eq 'www.fixmystreet.com' );
};
# set up DB handle for old code
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index ec3423f35..c4e33a3c1 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -40,8 +40,9 @@ sub base_url {
my $base_url = mySociety::Config::get('BASE_URL');
my $u = $self->council_url;
if ( $base_url !~ /$u/ ) {
- $base_url =~ s{http://(?!www\.)}{http://$u.}g;
- $base_url =~ s{http://www\.}{http://$u.}g;
+ # council cobrands are not https so transform to http as well
+ $base_url =~ s{(https?)://(?!www\.)}{http://$u.}g;
+ $base_url =~ s{(https?)://www\.}{http://$u.}g;
}
return $base_url;
}
@@ -59,7 +60,7 @@ sub area_check {
if ($council_match) {
return 1;
}
- my $url = 'http://www.fixmystreet.com/';
+ my $url = 'https://www.fixmystreet.com/';
if ($context eq 'alert') {
$url .= 'alert';
} else {
@@ -86,7 +87,7 @@ sub reports_body_check {
# We want to make sure we're only on our page.
unless ( $self->council_name =~ /^\Q$code\E/ ) {
- $c->res->redirect( 'http://www.fixmystreet.com' . $c->req->uri->path_query, 301 );
+ $c->res->redirect( 'https://www.fixmystreet.com' . $c->req->uri->path_query, 301 );
$c->detach();
}