Permalink
Browse files

Don't close the response OutputStream

Also don't flush the OutputStream. The Servlet Container will flush
and close the response OutputStream.
  • Loading branch information...
1 parent bcaef85 commit 4207073b8069aadfe6df81c565535ef04bdb778a @juergenhoetzel juergenhoetzel committed Sep 1, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 ring-servlet/src/ring/util/servlet.clj
View
6 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 4207073

Please sign in to comment.