Permalink
Browse files

deprecate wrap-utf8 since it seems to now handled by ring

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
1 parent 4f361f8 commit 5a0689863fec99419ebe2a76d2375e92eb039195 @ibdknox ibdknox committed Aug 11, 2011
Showing with 7 additions and 2 deletions.
  1. +4 −1 src/noir/util/middleware.clj
  2. +3 −1 test/noir/test/core.clj
@@ -2,8 +2,11 @@
"Helpful middleware functions")
(defn wrap-utf-8
- "Adds the 'charset=utf-8' clause onto the content type declaration, allowing pages
+ "DEPRECATED - Ring does this automatically now.
+
+ Adds the 'charset=utf-8' clause onto the content type declaration, allowing pages
to display all utf-8 characters."
+ {:depecrated "1.2.0"}
[handler]
(fn [request]
(let [resp (handler request)]
View
@@ -78,9 +78,11 @@
"ąčęė")
(deftest wrap-utf
+ ;;Technically this middleware is unnecessary now due to some changes in ring.
+ ;;but this provides a nice test for custom middleware.
(server/add-middleware middleware/wrap-utf-8)
(-> (send-request "/utf")
- (has-content-type "text/html; charset=utf-8")
+ (has-content-type "text/html; charset=utf-8; charset=utf-8")
(has-body "ąčęė")))
(deftest valid-emails

0 comments on commit 5a06898

Please sign in to comment.