Skip to content

Instantly share code, notes, and snippets.

@simonamor
Created October 6, 2020 09:23
Show Gist options
  • Select an option

  • Save simonamor/55b8925833dc415f29e927b58e94111c to your computer and use it in GitHub Desktop.

Select an option

Save simonamor/55b8925833dc415f29e927b58e94111c to your computer and use it in GitHub Desktop.
Patch for Catalyst::Request to allow reading body in begin() and still using body_data via Catalyst::Action::REST
diff -u Catalyst/Request.pm.orig Catalyst/Request.pm
--- Catalyst/Request.pm.orig 2020-10-06 10:17:47.549710876 +0100
+++ Catalyst/Request.pm 2020-10-06 10:17:31.352855930 +0100
@@ -130,6 +130,7 @@
if($match) {
my $fh = $self->body;
+ seek($fh,0,0);
local $_ = $fh;
return $self->data_handlers->{$match}->($fh, $self);
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment