summaryrefslogtreecommitdiff
path: root/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-09-13 16:45:08 -0400
committerLLLL Colonq <llll@colonq>2024-09-13 16:45:08 -0400
commitab5835df896f899d16ff29ed9db7475579071d77 (patch)
treee38c1266d670c504505ce983c3def7217b36ab36 /fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs
parentb3e610ff7f9ce87a1275c74ed34427c7e046b8c8 (diff)
Fix CloudFront situation
Let's not send empty JSON lists in GET request bodies anymore please
Diffstat (limited to 'fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs')
-rw-r--r--fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs
index b21a976..afd9266 100644
--- a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs
+++ b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs
@@ -77,9 +77,9 @@ authedRequest method url body = do
response <- liftIO $ HTTP.httpLbs request rc.manager
pure $ HTTP.responseBody response
-authedRequestJSON :: (Aeson.ToJSON a, Aeson.FromJSON b) => Text -> Text -> a -> Authed b
+authedRequestJSON :: (Aeson.ToJSON a, Aeson.FromJSON b) => Text -> Text -> Maybe a -> Authed b
authedRequestJSON method url val = do
- resp <- authedRequest method url $ Aeson.encode val
+ resp <- authedRequest method url $ maybe "" Aeson.encode val
case Aeson.eitherDecode resp of
Left err -> do
throwM . FigMonitorTwitchException $ tshow err