Open
Description
reopening issue #977, the suggested code to catch deserialization errors does not work.
post '/foo' => sub {
my $data = params('body') or die "couldn't deserialize " . request()->body;
};
there is no such params('body')
on successful deserialization. also, no param('body')
.
i do not see a safe way to detect such failures at this time -- especially since parameters
get merged together from URL and content.
hence, it would be necessary to try to deserialize manually to see if it fails...
IMO still, the right fix is to return 400 or a 4xx (suggesting it should be 500 was, of course, a mistake).
Metadata
Metadata
Assignees
Labels
No labels