-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
In my installation of Catalyst, I had to replace this line of code
catalyst-runtime/lib/Catalyst.pm
Line 4091 in ff923f7
| $slurped = $fh->getline; |
with a filehandle read operation (print and comments are not required)
#! WORKAROUND: using the old and reliable filehandle method
#- because $fh->getline doesn't return the JSON!
open(FH, $fh);
$slurped = <FH>;
print("*DEBUG* slurped is $slurped\n");
close(FH);
#! END OF WORKAROUNDbecause the getline makes the $slurped variable not have any content, which causes a JSON malformed error when attempting to access the HTTP request body via $c->req->body_data:
[2023/04/20 10:31:12] [catalyst] [ERROR] Error Parsing POST 'undef', Error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 at /home/nasaruk/perl5/lib/perl5/Catalyst.pm line 4092, <$fh> chunk 1.
[2023/04/20 10:31:12] [catalyst] [DEBUG] Response Code: 500; Content-Type: unknown; Content-Length: unknown
Maybe that getline method is heavily outdated and no-one noticed that it ceased to work.
Metadata
Metadata
Assignees
Labels
No labels