aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Seay <sam@manuka.co>2016-09-05 21:32:29 +1200
committerSamuel Seay <sam@manuka.co>2016-09-05 21:32:29 +1200
commita8da396dfc04e31854272d462e910a6c0ac35910 (patch)
tree7a80fcb18b1e4027858253b8f6ae83469685ae2c
parent29813771b6407683d2ad1c6a11ea0586add5dcd7 (diff)
downloadrecaptcha-a8da396dfc04e31854272d462e910a6c0ac35910.tar.gz
recaptcha-a8da396dfc04e31854272d462e910a6c0ac35910.tar.xz
Provide a default value for verify_url.
-rw-r--r--lib/recaptcha/http.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/recaptcha/http.ex b/lib/recaptcha/http.ex
index 6d81b76..b21f8f0 100644
--- a/lib/recaptcha/http.ex
+++ b/lib/recaptcha/http.ex
@@ -7,6 +7,8 @@ defmodule Recaptcha.Http do
{"Accept", "application/json"}
]
+ @default_verify_url "https://www.google.com/recaptcha/api/siteverify"
+
@doc """
Sends an HTTP request to the reCAPTCHA version 2.0 API.
@@ -33,7 +35,7 @@ defmodule Recaptcha.Http do
@spec request_verification(map, [timeout: integer]) :: {:ok, map} | {:error, [atom]}
def request_verification(body, options \\ []) do
timeout = options[:timeout] || Application.get_env(:recaptcha, :timeout, 5000)
- url = Application.get_env(:recaptcha, :verify_url)
+ url = Application.get_env(:recaptcha, :verify_url, @default_verify_url)
result =
with {:ok, response} <- HTTPoison.post(url, body, @headers, timeout: timeout),