From 658636463e07b01bfedaa074711c7e42ed1cb882 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 24 Oct 2016 22:18:43 +0200 Subject: [PATCH] Complete http stream after a response es emitted. --- src/uxbox/util/http.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uxbox/util/http.cljs b/src/uxbox/util/http.cljs index 15787d42e6..58adb8ec40 100644 --- a/src/uxbox/util/http.cljs +++ b/src/uxbox/util/http.cljs @@ -74,10 +74,11 @@ (letfn [(on-complete [event] (if (or (= (.getLastErrorCode xhr) ErrorCode.HTTP_ERROR) (.isSuccess xhr)) - (sink {:status (.getStatus xhr) - :body (.getResponse xhr) - :headers (normalize-headers - (.getResponseHeaders xhr))}) + (sink (rx/end + {:status (.getStatus xhr) + :body (.getResponse xhr) + :headers (normalize-headers + (.getResponseHeaders xhr))})) (sink (let [type (-> (.getLastErrorCode xhr) (translate-error-code)) message (.getLastError xhr)]