diff --git a/spec/domkm/silk/serve_spec.cljx b/spec/domkm/silk/serve_spec.cljx index 2aab410..7650553 100644 --- a/spec/domkm/silk/serve_spec.cljx +++ b/spec/domkm/silk/serve_spec.cljx @@ -41,11 +41,14 @@ (-> @req (@ring-handler) :params - (select-keys [:username :project]))) - (spec/should= @req + (select-keys [:username :project])))) + (spec/it + "won't override existing params in request" + (spec/should= "param" (-> @req + (assoc :params {:extra "param"}) (@ring-handler) - (dissoc :params))))) + (get-in [:params :extra]))))) (spec/context "match and no `get-handler` provided" (spec/it diff --git a/src/domkm/silk/serve.cljx b/src/domkm/silk/serve.cljx index e560265..08516dc 100644 --- a/src/domkm/silk/serve.cljx +++ b/src/domkm/silk/serve.cljx @@ -34,7 +34,7 @@ (fn [req] (if-let [params (silk/match rtes (request-map->URL req))] ((-> params :domkm.silk/name get-handler) - (assoc req :params params)) + (update req :params merge params)) ((get-handler nil) req))))))