Skip to content

Commit

Permalink
Don't deserialize multipart data w/serializer set
Browse files Browse the repository at this point in the history
Dancer2::Core::Request would unsuccessfully attempt to deserialize
multipart/form-data when a serializer had been set.

Closes #1677
  • Loading branch information
Emil Nicolaie Perhinschi authored and cromedome committed Aug 1, 2023
1 parent ba11df9 commit 4e9d6a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Dancer2/Core/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ sub data { $_[0]->{'data'} ||= $_[0]->deserialize() }
sub deserialize {
my $self = shift;

# don't attempt to deserialize if the form is 'multipart/form-data'
if (
$self->content_type
&& $self->content_type =~ /^multipart\/form-data/i
) {
return;
}


my $serializer = $self->serializer
or return;

Expand Down

0 comments on commit 4e9d6a2

Please sign in to comment.