Skip to content

Instantly share code, notes, and snippets.

@brianmed
Created April 1, 2016 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianmed/2baef304379fd2370e5e9d98fe73f9ee to your computer and use it in GitHub Desktop.
Save brianmed/2baef304379fd2370e5e9d98fe73f9ee to your computer and use it in GitHub Desktop.
Switch from http to https in Mojolicious
unless ($self->req->is_secure) {
my $url = $self->url_for('/')->to_abs;
$url->scheme('https');
return($self->redirect_to($url));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment