Post #1794746
2026-04-26 10:38 UTC
Spent an afternoon fooling around with #Clojure and being confused about why in my HTTP hander setup based on Reitit, the type of a file parameter delivered to a function handling multipart request is dependent on if the sender of the request decides to send multiple files with the same name.
If it was possible to send many, IMO it'd make better sense to just always give a sequence.
Maybe it's just an artefact from some historical choice made at https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/multipart_params.clj#L82
Replies (1)
-
@weavejester@mastodon.social 2026-04-27 12:08
@muep It was done that way to maintain backward compatibility with earlier versions of Ring. Form parameters are a difficult compromise because while parameter names are not required to be unique, in practice it's quite rare to use duplicate names, as its usually better to use explicit IDs than rely on implicit ordering for identification.