Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit ce421d8

Browse files
committed
[DEVOPS-834] faucet: make recaptcha optional in WithdrawalRequest
Helps when testing locally using curl. If there is a recaptcha secret configured, it will fail the recaptcha check and return HTTP 400.
1 parent 5a57bb4 commit ce421d8

File tree

1 file changed

+2
-2
lines changed
  • faucet/src/Cardano/Faucet/Types

1 file changed

+2
-2
lines changed

Diff for: faucet/src/Cardano/Faucet/Types/API.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Control.Exception.Safe
2121
import Control.Lens (at, makeLenses, makePrisms, makeWrapped, mapped,
2222
(?~), _Wrapped)
2323
import Data.Aeson (FromJSON (..), ToJSON (..), object, withObject,
24-
(.:), (.=))
24+
(.:), (.=), (.:?), (.!=))
2525
import qualified Data.Char as Char
2626
import Data.Proxy
2727
import Data.String (IsString (..))
@@ -64,7 +64,7 @@ makeLenses ''WithdrawalRequest
6464
instance FromJSON WithdrawalRequest where
6565
parseJSON = withObject "WithdrawalRequest" $ \v -> WithdrawalRequest
6666
<$> v .: "address"
67-
<*> (GCaptchaResponse <$> v .: "g-recaptcha-response")
67+
<*> (GCaptchaResponse <$> v .:? "g-recaptcha-response" .!= "")
6868

6969
instance FromForm WithdrawalRequest where
7070
fromForm f = WithdrawalRequest

0 commit comments

Comments
 (0)