From 31a50c75661e9bb58026643cecc11e448544e80e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 2 Sep 2013 10:20:59 -0400 Subject: make sure we buffer the entire input (backported from Plack a96a5b6) otherwise, the app may read things before the Web::Request instance does, and if the app doesn't buffer the input, then that data would not be seen --- lib/Web/Request.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/Web/Request.pm b/lib/Web/Request.pm index a895ef2..597530e 100644 --- a/lib/Web/Request.pm +++ b/lib/Web/Request.pm @@ -478,6 +478,8 @@ sub content { my $fh = $self->_input or return ''; my $cl = $self->content_length or return ''; + $fh->seek(0, 0); # just in case middleware/apps read it without seeking back + $fh->read(my $content, $cl, 0); $fh->seek(0, 0); -- cgit v1.2.3-54-g00ecf