Permalink
Browse files

Merge pull request #31 from juergenhoetzel/master

Don't close Outputstream (when using InputStream :body)
  • Loading branch information...
2 parents 5b3e6a8 + 4207073 commit 0476c7a1839874c7a758b4ee7d7575f39feda10e @weavejester weavejester committed Sep 21, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 ring-servlet/src/ring/util/servlet.clj
@@ -103,10 +103,8 @@
(.print writer (str chunk))
(.flush writer)))
(instance? InputStream body)
- (with-open [out (.getOutputStream response)
- ^InputStream b body]
- (io/copy b out)
- (.flush out))
+ (with-open [^InputStream b body]
+ (io/copy b (.getOutputStream response)))
(instance? File body)
(let [^File f body]
(with-open [stream (FileInputStream. f)]

0 comments on commit 0476c7a

Please sign in to comment.