Help for this page

Select Code to Download


  1. or download this
    $r->get('/login')->to('MyApp#https_redirect');
    
  2. or download this
    sub https_redirect {
        my $self = shift;
    ...
        my $secure = $self->req->url->to_abs->scheme('https')->port(443);
        $self->redirect_to($secure);
    }