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 261
261
[client]
262
262
(fn [req]
263
263
(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)
269
266
rsp
267
+ (cond
268
+
269
+ (false ? (opt req :throw-exceptions ))
270
+ rsp
270
271
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
276
277
(str " status: " status)
277
278
(assoc rsp :body (ByteArrayInputStream. body))))))
278
279
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
290
291
(ex-info
291
- (str " status: " status)
292
- (assoc rsp :body (s/->source body)))))))))))
292
+ (str " status: " status)
293
+ (assoc rsp :body (s/->source body) )))))))))))
293
294
294
295
(defn wrap-method
295
296
" Middleware converting the :method option into the :request-method option"
You can’t perform that action at this time.
0 commit comments