Skip to content

Commit

Permalink
Validate Uploaded files by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Crisan committed Feb 11, 2016
1 parent b301967 commit ef9d514
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Mojolicious/Plugin/ValidateTiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ sub register {
# Validate GET+POST parameters by default
$params ||= $c->req->params->to_hash();

# Validate Uploaded files by default
$params->{ $_->name } ||= $_ for (@{ $c->req->uploads });

#Latest mojolicious has an issue in that it doesn't include route supplied parameters so we need to hack that in.
$params = { %{$params}, %{$c->stash->{'mojo.captures'}} };

Expand Down

0 comments on commit ef9d514

Please sign in to comment.