Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
package MyApp;
__PACKAGE__->request_class('MyApp::Request');
package MyApp::Request;
use strict;
use parent 'Catalyst::Request';
sub method {
my $self = shift;
return $self->NEXT::method(@_) if @_;
my $method = $self->NEXT::method;
return $method unless uc($method) eq 'POST';
my $overload = $self->param('_method') || $self->param('x-tunneled-method');
return $overload ? uc($overload) : $method;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment