Skip to content

Commit

Permalink
make sure multiple CSRF tokens are rejected (closes #905)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 10, 2016
1 parent fa8311b commit d14e796
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/mojolicious/validation_lite_app.t
Expand Up @@ -227,6 +227,10 @@ $validation = $t->app->validation->input({csrf_token => 'abc', foo => 'bar'})
ok !$validation->has_error, 'no error';
ok $validation->required('foo')->is_valid, 'valid';
is_deeply $validation->output, {foo => 'bar'}, 'right result';
$validation = $t->app->validation->input({csrf_token => ['abc', 'def']})
->csrf_token('abc')->csrf_protect;
ok $validation->has_error, 'has error';
is_deeply $validation->error('csrf_token'), ['csrf_protect'], 'right error';

# Missing method and function (AUTOLOAD)
eval { $t->app->validation->missing };
Expand Down

0 comments on commit d14e796

Please sign in to comment.