atuttle / Taffy

:candy: The REST Web Service framework for ColdFusion and Lucee
http://taffy.io
Other
226 stars 117 forks source link

A PUT request with multipart/form-data is not properly processed #405

Open satauros opened 3 years ago

satauros commented 3 years ago

Description of the bug:

When PUT-ing a resource while using multipart/form-data, the _body key is not present in the arguments struct. This is not the case when using POST.

Proof:

image image

atuttle commented 3 years ago

To be clear, _body is only intended to be passed as an argument when the input data is not recognizable or when it is something other than a MAP type (e.g. struct/object). For example, if you send a JSON array as the request body, Taffy wouldn't know how to handle this and would provide it to the appropriate resource as the _body argument.

However, if we make the assumption that the resource used in your screen shots is dumping the arguments scope (which I believe is what we had discussed in slack) then they illustrate a different problem that we should address. I don't currently recall any reason that we should not parse form inputs into params for a PUT request. It's been a while since I looked at this code but we might be making the assumption that PUT implies data will come in query params, which would be incorrect in this case.