mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Read :headers from request :headers. not :header-params
This commit is contained in:
parent
af2d792290
commit
282fa7f012
3 changed files with 4 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
|||
* the `r/routes` returns just the path + data tuples as documented, not the compiled route results. To get the compiled results, use `r/compiled-routes` instead.
|
||||
* new [faster](https://github.com/metosin/reitit/blob/master/perf-test/clj/reitit/impl_perf_test.clj) and more correct encoders and decoders for query & path params.
|
||||
* query-parameters are encoded with `reitit.impl/form-encode`, so spaces are `+` instead of `%20`.
|
||||
* correctly read `:header` params from request `:headers`, not `:header-params`
|
||||
* welcome route name conflict resolution! If router has routes with same names, router can't be created. fix 'em.
|
||||
* sequential child routes are allowed, enabling this:
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
{:query (->ParameterCoercion :query-params :string true true)
|
||||
:body (->ParameterCoercion :body-params :body false false)
|
||||
:form (->ParameterCoercion :form-params :string true true)
|
||||
:header (->ParameterCoercion :header-params :string true true)
|
||||
:header (->ParameterCoercion :headers :string true true)
|
||||
:path (->ParameterCoercion :path-params :string true true)})
|
||||
|
||||
(defn ^:no-doc request-coercion-failed! [result coercion value in request]
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
:query-params {"a" "1"}
|
||||
:body-params {:b 2}
|
||||
:form-params {:c 3}
|
||||
:header-params {:d 4}})
|
||||
:headers {"d" "4"}})
|
||||
|
||||
(def invalid-request
|
||||
{:uri "/api/plus/5"
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
:query-params {"a" "1"}
|
||||
:body-params {:b 2}
|
||||
:form-params {:c 3}
|
||||
:header-params {:d -40}})
|
||||
:headers {"d" "-40"}})
|
||||
|
||||
(deftest spec-coercion-test
|
||||
(let [create (fn [middleware]
|
||||
|
|
|
|||
Loading…
Reference in a new issue