File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 554
554
; ; might be different in case we use :multipart
555
555
(reset! save-body body))
556
556
557
- (netty/safe-execute ch
558
- (http/send-message ch true ssl? req' body))))
557
+ (-> (netty/safe-execute ch
558
+ (http/send-message ch true ssl? req' body))
559
+ (d/catch' (fn [e]
560
+ (s/put! responses e)
561
+ (netty/close ch))))))
559
562
560
563
; ; this will usually happen because of a malformed request
561
564
(catch Throwable e
Original file line number Diff line number Diff line change 539
539
(try
540
540
(send-streaming-body ch msg body)
541
541
(catch Throwable e
542
- (log/error e " error sending body of type " class-name)))))]
542
+ (log/error e " error sending body of type " class-name)
543
+ (throw e)))))]
543
544
544
545
(when-not keep-alive?
545
546
(handle-cleanup ch f))
Original file line number Diff line number Diff line change 273
273
{:body (io/file " test/file.txt" )
274
274
:pool client-pool}))))))))
275
275
276
+ (deftest test-invalid-body
277
+ (let [client-url (str " http://localhost:" port)]
278
+ (with-handler identity
279
+ (is (thrown? IllegalArgumentException
280
+ @(http-put client-url
281
+ {:body 123 }))))))
282
+
276
283
(def characters
277
284
(let [charset (conj (mapv char (range 32 127 )) \newline)]
278
285
(repeatedly #(rand-nth charset))))
You can’t perform that action at this time.
0 commit comments