diff --git a/modules/reitit-core/src/reitit/core.cljc b/modules/reitit-core/src/reitit/core.cljc index 6b906a78..d56f3bbb 100644 --- a/modules/reitit-core/src/reitit/core.cljc +++ b/modules/reitit-core/src/reitit/core.cljc @@ -122,9 +122,8 @@ (match-by-name [_ name] (if-let [match (impl/fast-get lookup name)] (match nil))) - (match-by-name [_ name path-params] - (if-let [match (impl/fast-get lookup name)] - (match (impl/path-params path-params)))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (if-let [match (impl/fast-get lookup name)] (match (impl/path-params path-params opts)))))))) @@ -164,9 +163,8 @@ (match-by-name [_ name] (if-let [match (impl/fast-get lookup name)] (match nil))) - (match-by-name [_ name path-params] - (if-let [match (impl/fast-get lookup name)] - (match (impl/path-params path-params)))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (if-let [match (impl/fast-get lookup name)] (match (impl/path-params path-params opts)))))))) @@ -214,9 +212,8 @@ (match-by-name [_ name] (if-let [match (impl/fast-get lookup name)] (match nil))) - (match-by-name [_ name path-params] - (if-let [match (impl/fast-get lookup name)] - (match (impl/path-params path-params)))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (if-let [match (impl/fast-get lookup name)] (match (impl/path-params path-params opts)))))))) @@ -247,8 +244,8 @@ (if (#?(:clj .equals :cljs =) p path) match)) (match-by-name [_ name] (if (= n name) match)) - (match-by-name [_ name path-params] - (if (= n name) (impl/fast-assoc match :path-params (impl/path-params path-params)))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (if (= n name) (impl/fast-assoc match :path-params (impl/path-params path-params opts)))))))) @@ -279,9 +276,8 @@ (match-by-name [_ name] (or (match-by-name static-router name) (match-by-name wildcard-router name))) - (match-by-name [_ name path-params] - (or (match-by-name static-router name path-params) - (match-by-name wildcard-router name path-params))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (or (match-by-name static-router name path-params opts) (match-by-name wildcard-router name path-params opts))))))) @@ -313,9 +309,8 @@ (match-by-name [_ name] (or (match-by-name mixed-router name) (match-by-name linear-router name))) - (match-by-name [_ name path-params] - (or (match-by-name mixed-router name path-params) - (match-by-name linear-router name path-params))) + (match-by-name [r name path-params] + (match-by-name r name path-params nil)) (match-by-name [_ name path-params opts] (or (match-by-name mixed-router name path-params opts) (match-by-name linear-router name path-params opts))))))) diff --git a/modules/reitit-core/src/reitit/impl.cljc b/modules/reitit-core/src/reitit/impl.cljc index efa5a556..5e40e01e 100644 --- a/modules/reitit-core/src/reitit/impl.cljc +++ b/modules/reitit-core/src/reitit/impl.cljc @@ -297,10 +297,10 @@ (defn path-params "Convert parameters' values into URL-encoded strings, suitable for URL paths" - ([params] (maybe-map-values #(url-encode (into-string %)) params)) + ([params] (path-params params nil)) ([params {:keys [url-encode?] :or {url-encode? true}}] (if url-encode? - (path-params params) + (maybe-map-values #(url-encode (into-string %)) params) (maybe-map-values #(into-string %) params)))) (defn- query-parameter [k v]