From a8da396dfc04e31854272d462e910a6c0ac35910 Mon Sep 17 00:00:00 2001 From: Samuel Seay Date: Mon, 5 Sep 2016 21:32:29 +1200 Subject: Provide a default value for verify_url. --- lib/recaptcha/http.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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), -- cgit v1.2.1