From aef71fdbaed5091a9bf6e8c8f9d81149fbc0d4bc Mon Sep 17 00:00:00 2001 From: Daniel Bowling Date: Sat, 23 Jan 2021 19:23:22 -0500 Subject: [PATCH] Clean up excess redirects --- wethepeople.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wethepeople.pl b/wethepeople.pl index 1de9328..143bc02 100755 --- a/wethepeople.pl +++ b/wethepeople.pl @@ -5,12 +5,13 @@ use Mojolicious::Lite; get '/' => sub { my ($c) = @_; my $hostHeader = $c->req->headers->host(); + my $scheme = $c->req->url->base->scheme(); if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) { $c->render() } else { - $c->redirect_to('http://www.wethepeople.win') + $c->redirect_to("$scheme://www.wethepeople.win") } } => 'index';