Skip to content

Commit

Permalink
Merge pull request #2 from aviaviavi/empty_body
Browse files Browse the repository at this point in the history
Empty body fix
  • Loading branch information
aviaviavi authored Mar 15, 2018
2 parents e6c2a8c + 59b8167 commit 8902218
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions curl-runnings.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 9530ddd7493ff79858e3c01c7064eb8119932f625cdb1fa3f5cb93e3b3786189
-- hash: d332c7a791f625223c40a000c154539fd654b29190ff31c7909569c212cfa8b4

name: curl-runnings
version: 0.3.0
version: 0.3.1
synopsis: A framework for declaratively writing curl based API tests
description: Please see the README on Github at <https://github.com/aviaviavi/curl-runnings#readme>
category: Testing
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: curl-runnings
version: 0.3.0
version: 0.3.1
github: aviaviavi/curl-runnings
license: MIT
author: Avi Press
Expand Down
3 changes: 2 additions & 1 deletion src/Testing/CurlRunnings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Testing.CurlRunnings

import Control.Monad
import Data.Aeson
import Data.Aeson.Types
import qualified Data.ByteString.Char8 as B8S
import qualified Data.ByteString.Lazy as B
import qualified Data.CaseInsensitive as CI
Expand Down Expand Up @@ -46,7 +47,7 @@ runCase curlCase = do
httpBS .
(setRequestHeaders
(toHTTPHeaders $ fromMaybe (HeaderSet []) (headers curlCase))) .
setRequestBodyJSON (requestData curlCase) $
setRequestBodyJSON (fromMaybe (emptyObject) (requestData curlCase)) $
initReq {method = B8S.pack . show $ requestMethod curlCase}
returnVal <-
(return . decode . B.fromStrict $ getResponseBody response) :: IO (Maybe Value)
Expand Down

0 comments on commit 8902218

Please sign in to comment.