diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-08 18:10:13 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-11 17:02:25 +0000 |
commit | 1825a09bbdfee97928a251a84534d859b1a43387 (patch) | |
tree | 62bfe6f37a2a7c958f86e3641aacae75399a01c0 /perllib/FixMyStreet/App.pm | |
parent | fb65300cbf6fb9ca9ad077b12d44f188294d8005 (diff) |
Better working of /fakemapit/ under https.
If no MAPIT_URL is provided, MapIt lookups default to /fakemapit/ at the
same host. But that host might already be set up for HTTPS, so port
might be 443.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 21f9082bb..2a279c4e2 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -237,9 +237,9 @@ sub setup_request { $c->stash->{map_js} = FixMyStreet::Map::map_javascript(); unless ( FixMyStreet->config('MAPIT_URL') ) { - my $port = $c->req->uri->port; - $host = "$host:$port" unless $port == 80; - mySociety::MaPit::configure( "http://$host/fakemapit/" ); + my $host_port = $c->req->uri->host_port; + my $scheme = $c->req->uri->scheme; + mySociety::MaPit::configure( "$scheme://$host_port/fakemapit/" ); } $c->stash->{has_fixed_state} = FixMyStreet::DB::Result::Problem::fixed_states->{fixed}; |