Skip to content

Commit b11d5f6

Browse files
authored
v3: init default client when not specified (#14)
1 parent cae095a commit b11d5f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

recaptcha.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func V2(opts Options) flamego.Handler {
6363
// V3 returns a middleware handler that injects recaptcha.RecaptchaV3
6464
// into the request context, which is used for verifying reCAPTCHA V3 requests.
6565
func V3(opts Options) flamego.Handler {
66+
if opts.Client == nil {
67+
opts.Client = http.DefaultClient
68+
}
69+
6670
if opts.Secret == "" {
6771
panic("recaptcha: empty secret")
6872
}

0 commit comments

Comments
 (0)