Skip to content

Instantly share code, notes, and snippets.

@augensalat
Created July 6, 2015 11:11
Show Gist options
  • Save augensalat/4903218000b4a4d2f286 to your computer and use it in GitHub Desktop.
Save augensalat/4903218000b4a4d2f286 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojolicious/Plugin/MethodOverride.pm b/lib/Mojolicious/Plugin/MethodOverride.pm
index 3a09501..e9a7f27 100644
--- a/lib/Mojolicious/Plugin/MethodOverride.pm
+++ b/lib/Mojolicious/Plugin/MethodOverride.pm
@@ -9,6 +9,9 @@ our $VERSION = '0.053';
sub register {
my ($self, $app, $conf) = @_;
+ my $log = $app->log;
+
+ weaken $log;
my $header =
exists $conf->{header} ? $conf->{header} : 'X-HTTP-Method-Override';
@@ -35,7 +38,7 @@ sub register {
}
if ($method and $method =~ /^[A-Za-z]+$/) {
- $app->log->debug(($header // $param) . ': ' . $method);
+ $log->debug(($header // $param) . ': ' . $method);
$req->method($method);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment