diff --git a/src/clj/http/async/client/request.clj b/src/clj/http/async/client/request.clj index a034ff0..1450c34 100644 --- a/src/clj/http/async/client/request.clj +++ b/src/clj/http/async/client/request.clj @@ -255,6 +255,8 @@ onCompleted [this] (do (completed resp) + (when-not (realized? (:body resp)) + (deliver (:body resp) nil)) (deliver (:done resp) true))) (^{:tag void} onThrowable [this #^Throwable t] diff --git a/test/http/async/client/test.clj b/test/http/async/client/test.clj index 6dbae1f..ba91a4a 100644 --- a/test/http/async/client/test.clj +++ b/test/http/async/client/test.clj @@ -598,7 +598,7 @@ (is (thrown-with-msg? RuntimeException #"Closed" (GET client "http://localhost:8123/"))))) (deftest extract-empty-body - (let [resp (await (GET *client* "http://localhost:8123/empty"))] + (let [resp (GET *client* "http://localhost:8123/empty")] (is (nil? (string resp))))) ;;(deftest profile-get-stream