Closed Tsuribori closed 2 years ago
Regarding the "Handling file uploads" code example
https://github.com/kit-clj/kit-clj.github.io/blob/3ee6e6952c67c7cd4fa7f25d357d2f182873b4d3/resources/md/routes.md?plain=1#L147-L157
With
ring/ring-core {:mvn/version "1.9.5"} ring/ring-defaults {:mvn/version "0.3.3"}
there is no :parameters key but rather the following
:parameters
(:reitit.core/match :reitit.core/router :protocol :cookies :remote-addr :params :flash :headers :server-port :content-length :form-params :websocket? :session/key :server-exchange :query-params :content-type :character-encoding :context :uri :server-name :anti-forgery-token :query-string :path-params :body :multipart-params :scheme :request-method :session)
The :multipart-params contains the parameters in string-key form while the same things are in :params in keyword-key form. This seems to be because ring-defaults doesn't do anything to :multipart-params.
:multipart-params
:params
ring-defaults
Should the example be fixed to using :params?
Good catch, Reitit uses :parameters, but Ring middleware for multipart params uses a :params key.
Regarding the "Handling file uploads" code example
https://github.com/kit-clj/kit-clj.github.io/blob/3ee6e6952c67c7cd4fa7f25d357d2f182873b4d3/resources/md/routes.md?plain=1#L147-L157
With
there is no
:parameters
key but rather the followingThe
:multipart-params
contains the parameters in string-key form while the same things are in:params
in keyword-key form. This seems to be becausering-defaults
doesn't do anything to:multipart-params
.Should the example be fixed to using
:params
?