Skip to content

Commit

Permalink
Fixed wrap-lint middleware to accept ISeq as valid response body
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Feb 27, 2011
1 parent b5909c9 commit 9a3cc92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ring-devel/src/ring/middleware/lint.clj
Expand Up @@ -77,9 +77,9 @@
(lint hval #(or (string? %) (every? string? %))
"header values must be Strings or colls of Strings")))

(lint (:body resp) #(or (nil? %) (string? %) (instance? File %)
(lint (:body resp) #(or (nil? %) (string? %) (seq? %) (instance? File %)
(instance? InputStream %))
":body must a String, File, or InputStream"))
":body must a String, ISeq, File, or InputStream"))

(defn wrap-lint
"Wrap an app to validate incoming requests and outgoing responses
Expand Down
2 changes: 1 addition & 1 deletion ring-devel/test/ring/middleware/lint_test.clj
Expand Up @@ -123,5 +123,5 @@
[nil {:foo "bar"} {"foo" :bar} {"dir" 123}])

(lints-resp :body
[nil "thebody" (tu/string-input-stream "thebody") (File. "test/ring/assets/foo.html")]
[nil "thebody" (list "foo" "bar") (tu/string-input-stream "thebody") (File. "test/ring/assets/foo.html")]
[123 :thebody])

0 comments on commit 9a3cc92

Please sign in to comment.