Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-237

MultipartFormDataInput and it's implementation MultipartFormDataInputImpl can not represent/process a multipart/form-data request where the same Content-Disposition name is used by more parts

    XMLWordPrintable

Details

    Description

      MultipartFormDataInput only has a
      Map<String, InputPart> getFormData();
      method which only allows one InputPart per name. However it is not uncommon to have more than one part by the same name.

      The implementation MultipartFormDataInputImpl overwrites the parts in the Map so after parsing it will only hold the last InputPart per name.

      I think the interface should have a method that gets a Map<String, List<InputPart>> back and the implementation needs to support that. However if this will be the case a decision is needed what to do with the current getFormData() method. It can be deleted (breaking compatibility) or make it work along the new method and maybe made deprecated.

      I have read the rfc2388 and it caused me a bit of a confusion because it writes this:
      "In forms, there are a series of fields to be supplied by the user who fills out the form. Each field has a name. Within a given form, the names are unique."
      In my interpretation here the form refers to HTML forms. However on w3.org it is stated in [2] that
      "Several checkboxes in a form may share the same control name. Thus, for example, checkboxes allow users to select several values for the same property."

      So in html forms the names are not unique (and it used so in a lot of cases like in Spring MVC checkbox support). So thats why I think in multipart/form-data it is also allowed to have more parts with the same name.

      [1] rfc2388 - http://www.ietf.org/rfc/rfc2388.txt
      [2] html 4.01 checkbox input - http://www.w3.org/TR/html401/interact/forms.html#checkbox

      This issue should be fixed after the mime4j related issue (RESTEASY-233) is done because they modify the same classes.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            akiraly Attila Király (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: