Skip to content

Commit

Permalink
v3: init default client when not specified (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon authored Mar 16, 2022
1 parent cae095a commit b11d5f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recaptcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func V2(opts Options) flamego.Handler {
// V3 returns a middleware handler that injects recaptcha.RecaptchaV3
// into the request context, which is used for verifying reCAPTCHA V3 requests.
func V3(opts Options) flamego.Handler {
if opts.Client == nil {
opts.Client = http.DefaultClient
}

if opts.Secret == "" {
panic("recaptcha: empty secret")
}
Expand Down

0 comments on commit b11d5f6

Please sign in to comment.