$self->hook(before_dispatch => sub { my $c = shift; my $req = $c->tx->req; if($req->method eq 'POST' and $req->url =~ m!/firmware/add!) { $req->max_message_size(104_857_600); # around 100MB for firmware upload } });