Skip to content

Commit

Permalink
Lazy seq output flushes stream after each write
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Jul 10, 2009
1 parent 7f26bd3 commit 5e1a96f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compojure/http/servlet.clj
Expand Up @@ -82,7 +82,8 @@
(seq? body)
(with-open [writer (.getWriter response)]
(doseq [chunk body]
(.print writer (str chunk))))
(.print writer (str chunk))
(.flush writer)))
(instance? InputStream body)
(with-open [out (.getOutputStream response)]
(IOUtils/copy body out)
Expand Down

0 comments on commit 5e1a96f

Please sign in to comment.