Uploaded image for project: 'Chemistry (Retired)'
  1. Chemistry (Retired)
  2. CMIS-844

POSTHttpServletRequestWrapper should accommodate prior consumption of request body by a filter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • OpenCMIS 0.12.0
    • OpenCMIS 0.13.0
    • opencmis-server
    • None

    Description

      POSTHttpServletRequestWrapper should accommodate prior consumption of the request body by a filter.

      The 0.7.0 release provided this accommodation. This appears to have been broken by the major post-0.7.0 refactoring.

      The following POSTHttpServletRequestWrapper constructor modification fixes the problem:

      ...
              if (isMultipart) {
      ...
              } else {
                  // form data processing
                  StringBuilder sb = new StringBuilder();
      
                  InputStreamReader sr = new InputStreamReader(request.getInputStream(), IOUtils.UTF8);
                  char[] buffer = new char[4096];
                  int c = 0;
                  while ((c = sr.read(buffer)) > -1) {
                      sb.append(buffer, 0, c);
                  }
      
                  if (sb.length() < 3) {
                      @SuppressWarnings("unchecked")
                      Map<String, String[]> parameterMap = request.getParameterMap();
                      getParameterMap().putAll(parameterMap);
                  } else {
                      parseFormData(sb.toString());
                  }
              }
      ...
      

      Attachments

        Activity

          People

            fmui Florian Müller
            rgavlin Ron Gavlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: