Permalink
Browse files

Added ISeq and InputStream response types

  • Loading branch information...
1 parent 92b1d54 commit 8817e3cf9dfb55302bee99e89fd6d2de7d5dace4 @weavejester committed Jun 23, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/compojure/response.clj
View
@@ -1,8 +1,8 @@
(ns compojure.response
"Methods for generating Ring response maps"
(:import java.util.Map
- java.io.File
- [clojure.lang IDeref IFn]))
+ [java.io File InputStream]
+ [clojure.lang IDeref IFn ISeq]))
(defmulti render
"Given the request map and an arbitrary value x, turn x into a valid HTTP
@@ -28,4 +28,10 @@
(defmethod render File [_ file]
{:status 200, :headers {}, :body file})
+(defmethod render ISeq [_ coll]
+ {:status 200, :headers {}, :body coll})
+
+(defmethod render InputStream [_ stream]
+ {:status 200, :headers {}, :body stream})
+
(prefer-method render Map IFn)

0 comments on commit 8817e3c

Please sign in to comment.