From dba8d159cc932aba48dd39a6a938126511fd03f6 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Wed, 22 Jan 2025 10:22:58 +0200 Subject: [PATCH] . --- modules/reitit-core/src/reitit/core.cljc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/reitit-core/src/reitit/core.cljc b/modules/reitit-core/src/reitit/core.cljc index 7d28ed42..c3261b7c 100644 --- a/modules/reitit-core/src/reitit/core.cljc +++ b/modules/reitit-core/src/reitit/core.cljc @@ -78,14 +78,15 @@ ;; on the coercion? ;; NOTE: Re-creates coercer on every call, could this be pre-compiled somewhere ;; or memoized? Does it matter much? + ;; TODO: query-coercer could be compiled in reitit.frontend/router, same as request coercers. (str "?" (let [coercion (-> match :data :coercion) schema (when coercion (coercion/-compile-model coercion (-> match :data :parameters :query) nil)) coercer (when (and schema coercion) (coercion/-query-string-coercer coercion schema)) - query-params (or (when coercer - (coercer query-params :default)) - query-params)] + query-params (if coercer + (coercer query-params :default) + query-params)] ;; Default encoding for values will handle values that aren't encoded using coercer (impl/query-string query-params)))))))