Skip to content

Commit a8da396

Browse files
author
Samuel Seay
committed
Provide a default value for verify_url.
1 parent 2981377 commit a8da396

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/recaptcha/http.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ defmodule Recaptcha.Http do
77
{"Accept", "application/json"}
88
]
99

10+
@default_verify_url "https://www.google.com/recaptcha/api/siteverify"
11+
1012
@doc """
1113
Sends an HTTP request to the reCAPTCHA version 2.0 API.
1214
@@ -33,7 +35,7 @@ defmodule Recaptcha.Http do
3335
@spec request_verification(map, [timeout: integer]) :: {:ok, map} | {:error, [atom]}
3436
def request_verification(body, options \\ []) do
3537
timeout = options[:timeout] || Application.get_env(:recaptcha, :timeout, 5000)
36-
url = Application.get_env(:recaptcha, :verify_url)
38+
url = Application.get_env(:recaptcha, :verify_url, @default_verify_url)
3739

3840
result =
3941
with {:ok, response} <- HTTPoison.post(url, body, @headers, timeout: timeout),

0 commit comments

Comments
 (0)