From 6ead967447a5e70959ad6f12bde5ef042f401bb9 Mon Sep 17 00:00:00 2001 From: gered Date: Fri, 18 Jul 2014 13:30:09 -0400 Subject: [PATCH] fix following response "Location" headers to not just follow them with HTTP 201 responses --- src/clj_hl7_fhir/core.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clj_hl7_fhir/core.clj b/src/clj_hl7_fhir/core.clj index 66f1bff..ea6b89a 100644 --- a/src/clj_hl7_fhir/core.clj +++ b/src/clj_hl7_fhir/core.clj @@ -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)))