Created
April 1, 2016 22:55
-
-
Save brianmed/2baef304379fd2370e5e9d98fe73f9ee to your computer and use it in GitHub Desktop.
Switch from http to https in Mojolicious
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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