From 0405428e8d6d8227e788d281c5a2b860e7c7f667 Mon Sep 17 00:00:00 2001 From: William Lindley Date: Tue, 13 Jan 2015 12:51:47 -0500 Subject: [PATCH] Update/remove deprecated functions for compatibility with Mojolicious 5 --- bootylite.pl | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/bootylite.pl b/bootylite.pl index 2e29a7e..7ce3e57 100755 --- a/bootylite.pl +++ b/bootylite.pl @@ -12,7 +12,7 @@ my $config = plugin 'config'; # set cookie secret -app->secret($config->{secret} // 'Bootylite'); +app->secrets([$config->{secret} // 'Bootylite']); # use the right character encoding plugin charset => {charset => $config->{encoding}}; @@ -53,21 +53,7 @@ *Mojolicious::Controller::url_for = sub { my $c = shift; - # create urls - my $url = $url_for->($c, @_)->to_abs; - my $req_url = $c->req->url->to_abs; - - # return relative version if request url exists - if ($req_url->to_string) { - - # "repair" if empty - my $rel_url = $url->to_rel($req_url); - return Mojo::URL->new('./') unless $rel_url->to_string; - return $rel_url; - } - - # or change nothing - return $url; + return $url_for->($c, @_)->to_abs; }; }