Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from DarkGhostHunter/master
Browse files Browse the repository at this point in the history
Fixed variable string given by reCAPTCHA servers.
  • Loading branch information
DarkGhostHunter authored Jun 13, 2019
2 parents a49c6bd + 0ae50e1 commit 3bf4823
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Http/Middleware/CheckRecaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function isPostMethod(Request $request)
protected function hasValidRequest(Request $request)
{
$isValid = !$this->validator->make($request->only('_recaptcha'), [
'_recaptcha' => 'required|string|size:356',
'_recaptcha' => 'required|string|between:300,400',
])->fails();

return throw_unless($isValid, InvalidRecaptchaException::class, $request->only('_recaptcha'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Middleware/CheckRecaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testFailsOnNonPostMethod()

public function testFailsInvalidToken()
{
$response = $this->post('test-post', [ '_recaptcha' => Str::random(357)]);
$response = $this->post('test-post', [ '_recaptcha' => Str::random(401)]);

$response->assertStatus(500);
$this->assertInstanceOf(InvalidRecaptchaException::class, $response->exception);
Expand Down

0 comments on commit 3bf4823

Please sign in to comment.