fix following response "Location" headers to not just follow them with HTTP 201 responses

This commit is contained in:
Gered 2014-07-18 13:30:09 -04:00
parent bbea913abe
commit 6ead967447

View file

@ -18,8 +18,8 @@
:post (http-post-json url body)
:put (http-put-json url body)
:delete (http-delete-json url body))]
(-> (if (= 201 (:status response))
(http-get-json (get-in response [:headers "Location"]))
(-> (if-let [location (get-in response [:headers "Location"])]
(http-get-json location)
response)
:body
(json/parse-string true)))