Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewind body filehandle before reading JSON
If something else had already read from the filehandle, we'd get nothing, and end up throwing an error like: ``` [error] Caught exception in engine "Error Parsing POST 'undef', Error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /home/davidp/perl5/lib/perl5/Catalyst.pm line 4092, <$fh> chunk 11." ``` ... that sounds like we got an empty POST or something, but in fact the problem was that a plugin had caused the request body to have already been read, so the filehandle wasn't at the beginning. This seek means that we will read and parse the whole body content as intended, even if something had already read from the filehandle. I think this will also likely solve perl-catalyst#183.
- Loading branch information