File tree Expand file tree Collapse file tree 1 file changed +24
-23
lines changed Expand file tree Collapse file tree 1 file changed +24
-23
lines changed Original file line number Diff line number Diff line change 261261 [client]
262262 (fn [req]
263263 (d/let-flow' [{:keys [status body] :as rsp} (client req)]
264- (if (unexceptional-status? status)
265- rsp
266- (cond
267-
268- (false ? (opt req :throw-exceptions ))
264+ (when (some? rsp) ; will happen when `:aleph/close true` is set in req
265+ (if (unexceptional-status? status)
269266 rsp
267+ (cond
268+
269+ (false ? (opt req :throw-exceptions ))
270+ rsp
270271
271- (instance? InputStream body)
272- (d/chain' (d/future (bs/to-byte-array body))
273- (fn [body]
274- (d/error-deferred
275- (ex-info
272+ (instance? InputStream body)
273+ (d/chain' (d/future (bs/to-byte-array body))
274+ (fn [body]
275+ (d/error-deferred
276+ (ex-info
276277 (str " status: " status)
277278 (assoc rsp :body (ByteArrayInputStream. body))))))
278279
279- (nil? body)
280- (d/error-deferred
281- (ex-info
282- (str " status: " status)
283- rsp))
284-
285- :else
286- (d/chain'
287- (s/reduce conj [] body)
288- (fn [body]
289- (d/error-deferred
280+ (nil? body)
281+ (d/error-deferred
282+ (ex-info
283+ (str " status: " status)
284+ rsp))
285+
286+ :else
287+ (d/chain'
288+ (s/reduce conj [] body)
289+ (fn [body]
290+ (d/error-deferred
290291 (ex-info
291- (str " status: " status)
292- (assoc rsp :body (s/->source body)))))))))))
292+ (str " status: " status)
293+ (assoc rsp :body (s/->source body) )))))))))))
293294
294295(defn wrap-method
295296 " Middleware converting the :method option into the :request-method option"
You can’t perform that action at this time.
0 commit comments