Permalink
Browse files

Exctract ring.util.servlet/set-status.

  • Loading branch information...
1 parent 4b6bb69 commit 36a7954626250f4571f464d15926009bcffc10ff @mmcgrana committed Nov 1, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 ring-servlet/src/ring/util/servlet.clj
View
7 ring-servlet/src/ring/util/servlet.clj
@@ -52,7 +52,10 @@
:servlet-response response
:servlet-context (.getServletContext servlet)}))
-(defn- set-headers
+(defn set-status [^HttpServletResponse response, status]
+ (.setStatus response status))
+
+(defn set-headers
"Update a HttpServletResponse with a map of headers."
[^HttpServletResponse response, headers]
(doseq [[key val-or-vals] headers]
@@ -97,7 +100,7 @@
(when-not response
(throw (Exception. "Null response given.")))
(when status
- (.setStatus response status))
+ (set-status response status))
(doto response
(set-headers headers)
(set-body body)))

0 comments on commit 36a7954

Please sign in to comment.