Skip to content

Commit

Permalink
Removed default character encoding from servlet and adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Sep 22, 2012
1 parent aae8aaa commit 3e91c38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion ring-jetty-adapter/src/ring/adapter/jetty.clj
Expand Up @@ -17,7 +17,6 @@
(let [request-map (servlet/build-request-map request)
response-map (handler request-map)]
(when response-map
(.setCharacterEncoding response "UTF-8")
(servlet/update-servlet-response response response-map)
(.setHandled base-request true))))))

Expand Down
5 changes: 3 additions & 2 deletions ring-jetty-adapter/test/ring/adapter/test/jetty.clj
Expand Up @@ -59,8 +59,9 @@
(testing "default character encoding"
(with-server (content-type-handler "text/plain") {:port 4347}
(let [response (http/get "http://localhost:4347")]
(is (= (get-in response [:headers "content-type"])
"text/plain;charset=UTF-8")))))
(is (.contains
(get-in response [:headers "content-type"])
"text/plain")))))

(testing "custom content-type"
(with-server (content-type-handler "text/plain;charset=UTF-16;version=1") {:port 4347}
Expand Down
1 change: 0 additions & 1 deletion ring-servlet/src/ring/util/servlet.clj
Expand Up @@ -120,7 +120,6 @@
(fn [^HttpServlet servlet
^HttpServletRequest request
^HttpServletResponse response]
(.setCharacterEncoding response "UTF-8")
(let [request-map (-> request
(build-request-map)
(merge-servlet-keys servlet request response))]
Expand Down

0 comments on commit 3e91c38

Please sign in to comment.