furnace.recaptcha: logic in recaptcha-url was wrong, fix and test case

db4
Björn Lindqvist 2015-10-04 02:26:02 +02:00
parent 0a3b4b4872
commit 28c179cf59
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,10 @@
USING: furnace.recaptcha.private tools.test urls ;
IN: furnace.recaptcha.tests
{
URL" http://www.google.com/recaptcha/api/challenge"
URL" https://www.google.com/recaptcha/api/challenge"
} [
f recaptcha-url
t recaptcha-url
] unit-test

View File

@ -39,8 +39,7 @@ M: recaptcha call-responder*
XML] ;
: recaptcha-url ( secure? -- ? )
"http://www.google.com/recaptcha/api/challenge"
"https://www.google.com/recaptcha/api/challenge" ?
"https" "http" ? "://www.google.com/recaptcha/api/challenge" append
recaptcha-error cget [ "?error=" glue ] when* >url ;
: render-recaptcha ( -- xml )