Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed default middleware from routes

  • Loading branch information...
commit 0f2b10d43fcbd5d5661dfe9f0b3ab50b5c410967 1 parent 876e5f3
@weavejester authored
Showing with 6 additions and 35 deletions.
  1. +2 −10 src/compojure/core.clj
  2. +4 −25 test/compojure/test/core.clj
View
12 src/compojure/core.clj
@@ -2,11 +2,7 @@
"A concise syntax for generating Ring handlers."
(:use clojure.contrib.def
clout.core
- compojure.response
- [ring.middleware params
- keyword-params
- nested-params
- cookies]))
+ compojure.response))
(defn- method-matches
"True if this request matches the supplied method."
@@ -88,11 +84,7 @@
(defn routes
"Create a Ring handler by combining several handlers into one."
[& handlers]
- (-> #(apply routing % handlers)
- wrap-keyword-params
- wrap-nested-params
- wrap-params
- wrap-cookies))
+ #(apply routing % handlers))
(defmacro defroutes
"Define a Ring handler function from a sequence of routes. The name may be
View
29 test/compojure/test/core.clj
@@ -63,31 +63,10 @@
(GET "/bar" [] (is true) nil)))
(deftest routes-test
- (testing "multiple routes"
- ((routes
- (GET "/foo" [] (is false) nil)
- (GET "/bar" [] (is true) nil))
- (request :get "/bar")))
-
- (testing "keyword parameters"
- ((routes
- (GET "/:x" [x y & more]
- (is (= x "foo"))
- (is (= y "bar"))
- (is (= more {:z "baz"}))
- nil))
- (request :get "/foo" {:y "bar", :z "baz"})))
-
- (testing "nested parameters"
- ((routes
- (GET "/" [x y]
- (is (= x {:a "1", :b "2"}))
- (is (= y ["3" "4"]))
- nil))
- (request :get "/" [["x[a]" "1"]
- ["x[b]" "2"]
- ["y[]" "3"]
- ["y[]" "4"]]))))
+ ((routes
+ (GET "/foo" [] (is false) nil)
+ (GET "/bar" [] (is true) nil))
+ (request :get "/bar")))
(deftest wrap
(testing "wrap function"
Please sign in to comment.
Something went wrong with that request. Please try again.